.gitattributes diff filters are not respected when viewing diffs
Version info
- OS: Manjaro GNU/Linux 18.0.4
- gitg: 3.32.1
Description
Files with diff filters set in .gitattributes do not have their filters respected when viewing diffs in gitg. Instead, the diff says only Unable to display changes for binary file
.
This behavior is observed with git-crypt in particular, but this may also apply to other filters applied in .gitattributes
Steps to reproduce
Steps to reproduce the behavior:
$ mkdir test-repo && cd test-repo
$ git init
$ git crypt init
$ git crypt add-gpg-user emailforyourgpgkey@example.com
- Configure git-crypt to act on a file.
$ echo "secretfile filter=git-crypt diff=git-crypt" > .gitattributes
$ git add . && git commit -m "Add secretfile encryption to .gitattributes"
- Modify that file and stage the changes.
$ echo "this is secret" > secretfile && git add .
- View the diff in gitg.
$ gitg
Expected behavior
Instead of Unable to display changes for binary file
, the proper filtered diff should appear.
For my above example, the proper diff can be seen with
$ git diff --staged
diff --git a/secretfile b/secretfile
new file mode 100644
index 0000000..a2446a1
--- /dev/null
+++ b/secretfile
@@ -0,0 +1 @@
+this is secret
The same issue occurs with giggle, but works fine with gitk.
Edited by Ganden Schaffner