Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readme: Advice on how to implement a git filter #11

Closed
blaggacao opened this issue Dec 25, 2020 · 2 comments
Closed

Readme: Advice on how to implement a git filter #11

blaggacao opened this issue Dec 25, 2020 · 2 comments

Comments

@blaggacao
Copy link
Contributor

blaggacao commented Dec 25, 2020

DRY → divnix/digga#37

So that a similar functionality to git crypt can be achieved.

@blaggacao
Copy link
Contributor Author

blaggacao commented Dec 29, 2020

I guess the added value would lie in the metadata of ./secrets.nix. Some sort of clean & smudge,evtl. diff textconv function here?

A filter driver consists of a clean command and a smudge command, either of which can be left unspecified. Upon checkout, when the smudge command is specified, the command is fed the blob object from its standard input, and its standard output is used to update the worktree file. Similarly, the clean command is used to convert the contents of worktree file upon checkin.

When Git needs to show you a diff for the path with diff attribute set to jcdiff, it calls the command you specified with the above configuration, i.e. j-c-diff, with 7 parameters, just like GIT_EXTERNAL_DIFF program is called. See git[1] for details.

but further down

If you want to show differences between binary or specially-formatted blobs in your repository, you can choose to use either an external diff command, or to use textconv to convert them to a diff-able text format. Which method you choose depends on your exact situation.

The advantage of using an external diff command is flexibility. You are not bound to find line-oriented changes, nor is it necessary for the output to resemble unified diff. You are free to locate and report changes in the most appropriate way for your data format.

A textconv, by comparison, is much more limiting. You provide a transformation of the data into a line-oriented text format, and Git uses its regular diff tools to generate the output. There are several advantages to choosing this method: [ ... ]

(https://git-scm.com/docs/gitattributes)

@ryantm
Copy link
Owner

ryantm commented May 13, 2021

As I said in #14 I don't think a git filter makes sense because we want the secrets encrypted at rest.

@ryantm ryantm closed this as completed May 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants