[pass] Multiple password contexts

Adam Liter adam.liter at gmail.com
Thu Nov 17 00:19:38 CET 2016


Sorry I forgot the trailing slashes in the autocompletion stuff. That's 
what's in my config, but somehow that got lost in writing the email.

Anyway, regarding:

> Interesting suggestion! However, it appears that it might break the 
> git completion when you do that... or maybe I set something up wrong?

Are you talking about auto completion of the git subcommands to pass, or 
are you talking about the ability to have pass automatically write 
commits?

In either case, I've always used git submodules with pass, which isn't 
supported anyway, so I've never really relied on the git functionality 
of pass. Instead, I've written my own commits.

So it's quite possible this breaks whatever git functionality you're 
referring to, and I wouldn't have noticed because that was the status 
quo for me. :-p

There was discussion of this earlier on this mailing list, here: 
https://lists.zx2c4.com/pipermail/password-store/2016-February/002099.html

Lenz has a patch that would support git submodules. I haven't yet tried 
it out, though. I'm not really adding any new passwords to my current 
password store, so resolving this hasn't been a high priority for me, 
unfortunately.

-Adam

On 16 Nov 2016, at 13:59, Héctor Rivas Gándara wrote:

> That's exactly what the repo I posted does in the script .load.bash
>
> On 16 Nov 2016 18:36, "Andrew Dunn" <andrew.g.dunn at gmail.com> wrote:
>
>> I was able to get Adam's suggestions to work, albeit it required a 
>> bit
>> of mucking about.
>>
>> You'd need to set an alias for each pass<team> or whatever convention
>> you'd prefer to use:
>>
>> ```
>> vim ~/.bashrc
>> ---
>> alias passered="PASSWORD_STORE_DIR=~/.pass/red
>> PASSWORD_STORE_GIT=~/.pass/red pass"
>> alias passblue="PASSWORD_STORE_DIR=~/.pass/blue
>> PASSWORD_STORE_GIT=~/.pass/blue pass"
>> ```
>>
>> The key here is that you set both the variables, otherwise git won't
>> have any context when you use it.
>>
>> You then need to set your bash completion up, I'm on arch so the
>> completion path may be different for you:
>>
>> ```
>> vim ~/.bash_completion
>> ---
>> source /usr/share/bash-completion/completions/pass
>>
>> _passred(){
>>     PASSWORD_STORE_DIR=~/.pass/red/ _pass
>> }
>>
>> complete -o filenames -o nospace -F _passred passred
>>
>> _passblue(){
>>     PASSWORD_STORE_DIR=~/.pass/blue/ _pass
>> }
>>
>> complete -o filenames -o nospace -F _passblue passblue
>>
>> ```
>>
>> You need to have the trailing `/` on the PASSWORD_STORE_DIR path,
>> otherwise your completion will look like `//` instead of actual
>> folders within the directory.
>>
>> On Wed, Nov 16, 2016 at 10:47 AM, Héctor Rivas Gándara 
>> <keymon at gmail.com>
>> wrote:
>>>> Adam:
>>>>
>>>> Interesting suggestion! However, it appears that it might break the
>>>> git completion when you do that... or maybe I set something up 
>>>> wrong?
>>>
>>>
>>> I use this template git repo with some bash aliases:
>>>
>>> https://github.com/keymon/password-store-for-teams
>>>
>>> I have multiple password stores for multiple teams.
>>>
>>> Contributions are welcome, specially a equivalent for ksh and other
>> shells.
>>


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.zx2c4.com/pipermail/password-store/attachments/20161116/426cc789/attachment.html>


More information about the Password-Store mailing list