I solved it like this:

.git/config:

[filter "crypt"]
        clean = openssl enc -pbkdf2 -iter 10000 -aes-256-cbc -in %f && 
shred %f
        smudge = openssl enc -d -pbkdf2 -iter 10000 -aes-256-cbc
        required

.gitattributes
*  filter=crypt
On Monday, September 12, 2022 at 9:37:11 PM UTC+2 Ronny Forberger wrote:

> OK, thanks, I will maybe give it a try.
>
> On Monday, September 12, 2022 at 6:25:41 PM UTC+2 Konstantin Khomoutov 
> wrote:
>
>> On Mon, Sep 12, 2022 at 08:15:14AM -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 
>> [...]
>> > 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.
>>
>> OK, I think it's not possible.
>>
>> But then I think you're trying to approach the problem from a wrong side:
>> I think you need to use the so-called "attributes". Git attributes allow
>> setting up "clean" and "smudge" filters for files which are under the 
>> control
>> of Git: the first type of filters allow to change the blobs as found in 
>> the
>> work tree, and the second type of filters do the reverse - take a blob as
>> recorded in a commit, and change it in whatever way required to update the
>> matching file in the work tree.
>>
>> IMO, using smudge filters for decoding files is what is really needed.
>>
>> You can run `git help attributes` to learn about this feature.
>>
>>

-- 
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/6dfd064e-b643-4aa0-adcb-b3a54599bc58n%40googlegroups.com.

Reply via email to