On Mon, Sep 12, 2022 at 06:42:15AM -0700, Ronny Forberger wrote: [...] > > > I am trying to implement some encryption function with ansible-vault > > > into git hooks. > > > For decryption, I need the list of files passed on the command line to > > > git checkout command. I am using the post-checkout hook here. > > > I didn't find this information on the Internet. > > > > > > My post-checkout hook currently looks like: > > > > > > #!/bin/bash > > > set -eo pipefail > > > FILES=... > > > for f in $FILES; do > > > ansible-vault decrypt $f > > > done > > > > > > How can I access the command line arguments passed to git checkout in > > > the post-checkout hook? > > > > You cannot, but are the three parameters parsed to this hook not enough? > > > No, the parameters ($@) that are provided to the hook are not enough for me.
Still, can you explain why exactly? This is needed to exclude the possibility we're dealing with an XY Problem here. I mean, the argument to the post-checkout hook identify the previous state, the new state, and allow to distinguish between checking out a ref (a branch or a tag or a commit) and checking out the state of a particular file. -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/git-users/20220912141701.3uekpifhs4eqf7ei%40carbon.
