[pass] git-pass script

Maciej Pasternacki maciej at 3ofcoins.net
Fri Sep 19 23:09:31 CEST 2014


Hi all,

First and foremost: big kudos to everybody involved in creating pass! This
is the first password sharing software that is intuitively usable (at least
for techies), portable, stable, and future-proof that I've seen - and I've
been looking for quite a while. I am currently introducing it to my
consulting clients, and the response so far has also been rather positive.
Great job!

My itch was that it's not easy to work with multiple stores, or to check
out an existing git-managed store. While I can do a `git clone`, configure
some environment variables, and even set up a per-directory environment
variable contexts in zsh, it's not something I can recommend with straight
face to my clients. Best I could come up with was instructions to clone the
repository in ~/.password-store -- but then, the checkout still does not
live alongside checkouts of other repos of the project, and is kind of
invisible. I understand and appreciate that the whole idea for pass was to
be invisible and get out of user's sight as much as possible - but in
context of my work it tries a little bit too much.

To have pass working seamlessly in git checkouts under any path, with
password store as a subdirectory of an existing git repo, and work out of
the box in fresh clones, I have written a small wrapper script, named
"git-pass". It can go to $PATH and work as a "git pass" subcommand, or can
be committed to the repository and work as a standalone script. It allows
one to "cd" into a checkout, run "git pass ls" etc (or "./scripts/pass ls"
etc), and have it do the right thing.

To set up PASSWORD_STORE_DIR, it looks into Git configuration, and if it's
not present, it finds a directory containing all ".gpg-id" files that exist
in repo, so it will correctly recognize store in any subdirectory of the
repository. If there are no ".gpg-id" files, it defaults to root of working
tree, which allows initialization with "git repo init -p
path/to/subdirectory ...".

So far, it just Does What I Mean, and I have released the script on MIT
license in hope it will be useful not only for myself. You can see and
download the script at
https://gist.github.com/mpasternacki/e308be60eb2a67be080a

Happy hacking!
-- Maciej
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.zx2c4.com/pipermail/password-store/attachments/20140919/8eddbceb/attachment.html>


More information about the Password-Store mailing list