AGWA / git-crypt

Transparent file encryption in git
https://www.agwa.name/projects/git-crypt/
GNU General Public License v3.0
8.18k stars 475 forks source link

Make `git add --patch` work on encrypted files? #167

Open krish7919 opened 5 years ago

krish7919 commented 5 years ago

I have a large encrypted file which, when changed, is easier to review and commit using git add -p.

However, when I run a git add --patch on such a file, I get a Only binary files changed. message from git. I can see from the Git docs that the textconv option might not be used here.

Would it be possible to add support for this in git-crypt ?

Failing which, is there a workaround that I can do in my .gitconfig that can resolve this issue?

Thanks!

bqv commented 4 years ago

:+1: ditto on any temporary .gitconfig fix

rhansen commented 2 years ago

I think this must be fixed in Git itself, not in this project. From what I can tell, git add -p always operates on the output of the clean command (encrypt in this case), never on the output of the smudge command (decrypt).

(I think the right way to fix this is to change Git so that it runs the index's version of the file through the smudge command, and the working directory's version through a clean then smudge cycle, before diffing the results and prompting for hunks to add.)