Danny Roy 1225 st-Edgar
                        Drummondville                         Québec Canada     
                            j2B-2W4

Envoyé de mon iPhone

> Le 12 sept. 2022 à 11:15, Ronny Forberger <ronnyforber...@ronnyforberger.de> 
> a écrit :
> 
> I mean, I just want a list of files that are passed to the git checkout 
> command, not any related to the history of a file or its state.
> 
>> On Monday, September 12, 2022 at 4:17:08 PM UTC+2 Konstantin Khomoutov wrote:
>> 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 git-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/git-users/19a543bc-30c3-4f9e-89ee-7e3642266748n%40googlegroups.com.

-- 
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 git-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/git-users/FB917968-A637-4E40-BA46-7AF3A68D58DA%40gmail.com.

Reply via email to