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

Support for gpg encrypted files #179

Open
farynaio opened this issue Oct 17, 2020 · 2 comments
Open

Support for gpg encrypted files #179

farynaio opened this issue Oct 17, 2020 · 2 comments
Labels
enhancement new feature requested

Comments

@farynaio
Copy link

I found git-gutter doesn't work with gpg encrypted files. Is there a way to activate this in current version or this feature is missing?

@gonewest818
Copy link
Collaborator

You want to track the changes you've made in the buffer containing decrypted gpg text?

I haven't looked at the code to confirm this but this is my initial reaction ... The system uses your version control "diff" to figure out what lines have changed, and because gpg files are decrypted on the fly into a buffer it's very likely one of two problems. (1) git-gutter can't figure out the which file to perform a diff against, or (2) git-gutter tries to diff the decrypted buffer where you are editing against the encrypted file which isn't doing what you meant. I'm not sure how to deal with item #2 safely since we really don't want to be creating additional plaintext copies of your gpg file on disk... that seems to defeat the purpose of having it encrypted in the first place?

@gonewest818 gonewest818 added the enhancement new feature requested label Nov 1, 2020
@arichiardi
Copy link

The actual problem for me here is that git-gutter tries to write it's own temporary buffer, which actually triggers coding detection:

  select-safe-coding-system-interactively(1 10167 (raw-text no-conversion) (utf-8) nil raw-text)
  select-safe-coding-system(1 10167 utf-8 nil "/tmp/git-gutter-orig1cdyAL")
  git-gutter:write-original-content("/tmp/git-gutter-orig1cdyAL" "agenda/work.org.gpg")
  git-gutter:live-update()
  apply(git-gutter:live-update nil)
  timer-event-handler([nil 0 2 0 t git-gutter:live-update nil idle 0])

That select-safe-coding-system-interactively cannot know the coding of an encrypted *temp buffer* and a warning pops up:

These default coding systems were tried to encode text
in the buffer ‘ *temp file*-100837’:
...

As a workaround I am going to disable git-gutter on .org.gpg files for now (if possible).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement new feature requested
Development

No branches or pull requests

3 participants