[pass] Automatic git push and git pull

Jason A. Donenfeld Jason at zx2c4.com
Fri Feb 5 22:21:56 CET 2016


Lenz has what you want here!

On Saturday, January 2, 2016, Lenz Weber <mail at lenzw.de> wrote:

> It's not really nontrivial. I just have
>
> % cat .password-store/.git/hooks/post-commit
> git pull --rebase --recurse-submodules
> git push --recurse-submodules=on-demand
>
> It does not do everything you want, but it is very simple and most
> people here use something similar.
>
> If you are not using submodules, you can skip the recurse-submodules stuff.
>
>
> Regards,
> Lenz
>
>
> Am 02.01.2016 um 08:37 schrieb Asheesh Laroia:
> > Hi all,
> >
> > I've been a happy user of "pass" for a few years.
> >
> > I just set up a private git repository that I now use "pass git push" to
> > synchronize with.
> >
> > One thing I'm concerned about is that I might "pass generate" and then
> > forget to "pass git push". Particularly, I'm used to having monitoring
> > and/or automation for essential systems. So I'm curious - has anyone set
> > up automatic "git push" upon running "pass generate"?
> >
> > I know I could write some of my own scripts as git hooks, but it seems
> > to me it's a little nontrivial, so in the interest of saving time and
> > discovering existing best practices, I'm interested in finding out if
> > others have done something already.
> >
> > I'm interested in hearing about all approaches people have set up, even
> > ones they're not super thrilled with!
> >
> > Here's my first thought on how I'd do it (though happy to hear other
> > ideas too)
> >
> > - On "pass generate" (aka on creating a new local commit), do a "pass
> > git push", and if it fails, declare that it's OK that it failed
> >
> > - On "pass" (password copying), if origin/master is behind local master,
> > print a warning saying that I should "pass git push". (This handles
> > failure from the previous item.)
> >
> > - On "pass" (password copying), if origin/master and master are in sync
> > but origin/master hasn't been fetched in (say) 7 days, then print a
> > warning saying "You should probably run 'pass git pull'." Detect the
> > last fetch of origin/master by looking at the filesystem mtime of
> > .git/FETCH_HEAD, e.g. on my system:
> >
> > $ ls -l .git/FETCH_HEAD
> > -rw-r--r-- 1 paulproteus paulproteus 113 Jan  1 23:32 .git/FETCH_HEAD
> >
> >
> > Curious what others have done!
> >
> > Cheers,
> >
> > Asheesh.
> >
> >
> > _______________________________________________
> > Password-Store mailing list
> > Password-Store at lists.zx2c4.com <javascript:;>
> > http://lists.zx2c4.com/mailman/listinfo/password-store
> >
> _______________________________________________
> Password-Store mailing list
> Password-Store at lists.zx2c4.com <javascript:;>
> http://lists.zx2c4.com/mailman/listinfo/password-store
>


-- 
Jason A. Donenfeld
Deep Space Explorer
fr: +33 6 51 90 82 66
us: +1 513 476 1200
www.jasondonenfeld.com
www.zx2c4.com
zx2c4.com/keys/AB9942E6D4A4CFC3412620A749FC7012A5DE03AE.asc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.zx2c4.com/pipermail/password-store/attachments/20160205/94d43c8b/attachment.html>


More information about the Password-Store mailing list