GNU bug report logs -
#79050
vc-git incorrectly treats git-crypt encrypted files as binary, even when unlocked
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
Your message dated Mon, 21 Jul 2025 09:27:14 +0100
with message-id <87cy9ut0d9.fsf <at> zephyr.silentflame.com>
and subject line Re: bug#79050: vc-git incorrectly treats git-crypt encrypted files as binary, even when unlocked
has caused the debbugs.gnu.org bug report #79050,
regarding vc-git incorrectly treats git-crypt encrypted files as binary, even when unlocked
to be marked as done.
(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)
--
79050: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=79050
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
When using vc-diff in a Git repository where all files are
encrypted with git-crypt https://github.com/AGWA/git-crypt
the output does not reflect actual changes. Modified files
appear unaltered, regardless of edits made. (vc-diff appears
to compare the encrypted binary representations of the files,
rather than their decrypted contents.)
It appears that vc-diff does not take .gitattributes into
account, even though Git itself uses it to determine how to
handle diff filters. As a result, while git diff correctly
shows textual diffs for git-crypt encrypted files (once the
repository is unlocked), Emacs vc-diff treats them as binary
and fails to display the actual changes.
Instead of showing a textual diff, vc-diff reports:
diff --git a/file b/file
index a134576..8b24729 100644
Binary files a/file and b/file differ
Steps to Reproduce:
-------------------
1. Initialize a Git repository and enable git-crypt.
Create the repo:
----------------
mkdir -p repo
cd repo
git init
git-crypt init
echo test > README.md
Create the .gitattributes file:
-------------------------------
** filter=git-crypt diff=git-crypt
.gitattributes !filter !diff
Commit:
-------
git add .
git commit -m 'Init'
2. Open the README.md file in Emacs and modify it.
3. Run: M-x vc-diff
Expected Behavior
-----------------
vc-diff should display a textual diff showing the modified lines.
Actual Behavior
---------------
vc-diff reports the file as a binary difference with no
line-level changes, even though the repository is unlocked
and git diff in the terminal shows the correct diff.
Environment:
------------
- Emacs version: 31 (3b2bfdfef63f051a36f4043c32596458ccae605f)
2025-07-19 13:05:05 +0300
- OS: Arch Linux
--
James Cherti
GitHub: https://github.com/jamescherti
Website: https://www.jamescherti.com/
[Message part 3 (message/rfc822, inline)]
Version: 31.1
Hello,
On Sun 20 Jul 2025 at 02:28pm -04, James Cherti wrote:
> Hello Sean,
>
> Yes, adding `--textconv` resolves the issue.
Thanks for testing. Installed that change, and closing the bug.
--
Sean Whitton
This bug report was last modified 9 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.