elasticdog / transcrypt

transparently encrypt files within a git repository
MIT License
1.48k stars 102 forks source link

Is there any way to have diff's work inside git clients, such as Sublime Merge? #163

Closed othyn closed 1 year ago

othyn commented 1 year ago

I love this project, thank you for making it.

A gap in my knowledge on how this part of git works, but I'm wondering if I'm missing something and there is the ability to have diffs continue to function when inside git clients such as Sublime Merge?

As at the moment when viewing files in such git clients, the diff presented is that of the encrypted version of the file, instead of the decrypted one.

Not sure if this use case has come up yet!

othyn commented 1 year ago

Apologies! Appears this is a bug in Sublime Merge after looking further into it:

https://github.com/sublimehq/sublime_merge/issues/568

jmurty commented 1 year ago

Yeah, diffs should just work in clients that apply the .gitattributes directives. It's a shame your preferred client doesn't.

You will need to find another client to diff and merge transcrypt-encrypted files.

You should also be wary of committing secret files with that tool because it probably won't actually encrypt the contents. Transcrypt installs a pre-commit hook to try and prevent you committing and accidentally sharing files you thought would be encrypted but actually aren't, but I wouldn't recommend relying on it completely.

othyn commented 1 year ago

Yeah, diffs should just work in clients that apply the .gitattributes directives. It's a shame your preferred client doesn't.

You will need to find another client to diff and merge transcrypt-encrypted files.

Appears to be the way! A shame as its a good client otherwise.

You should also be wary of committing secret files with that tool because it probably won't actually encrypt the contents. Transcrypt installs a pre-commit hook to try and prevent you committing and accidentally sharing files you thought would be encrypted but actually aren't, but I wouldn't recommend relying on it completely.

It does respect the pre-commit hooks and stops exec if transcrypt fails or throws an error such as that, I've tested to make sure on that one! So we're all good there.