<div dir="ltr"><div><div><div><div>Hello,<br><br></div>I have a subdirectory in my pass-store to allow some passwords to be decrypted by multiple users. I do this using the `pass init -p <subdirectory> <user1> <user2> ...`<br><br></div>I would like to create a git hook that re-initializes if a change occurs in this directory, but I'm having trouble making this work. My thinking is that this needs to be a 'post-commit' hook because I think I want a change in the subdirectory (i.e. `pass insert <subdirectory/blah`) to cause a re-encryption. The issue is that I'm getting stuck in an infinite loop because a re-encryption causes a commit, which I would only like to do once.<br><br>```<br>SUBDIR=<mysubdirectory><br>echo "=== About to execute if"                                                                           <br>if git show --name-only | grep "^$SUBDIR                                                               <br>then                                                                                                     <br>    echo "=== Running pass..."                                                                           <br>    pass init -p $SUBDIR $(cat $HOME/.password-store/$SUBDIR/.gpg-id)                                  <br>    echo "=== Done running pass..."                                                                      <br>    exit 0                                                                                               <br>fi                                                                                                       <br>echo "=== Finished if"<br>```<br><br></div>This doesn't work because it goes into an infinite loop. Every initialization launches a new commit, and I don't think I can bypass the hook using the git commit --no-verify flag.<br></div><br>Are there any ideas here?<br></div>