Skip to content

.gitattributes diff filters are not respected when viewing diffs #568

@gschaffner

Description

@gschaffner

Version info

  • OS: Manjaro GNU/Linux 18.0.4
  • Build: 1116

Description

Files with diff filters set in .gitattributes do not have their filters respected when viewing diffs in Sublime Merge. Instead, the diff says only <binary file changed>.

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:

  1. Install git-crypt and initialize it on a repository. Instructions for initialization are here.
$ mkdir test-repo && cd test-repo
$ git init
$ git crypt init
$ git crypt add-gpg-user emailforyourgpgkey@example.com
  1. 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"
  1. Modify that file and stage the changes.
$ echo "this is secret" > secretfile && git add .
  1. View the diff in Sublime Merge.
$ smerge .

Expected behavior

Instead of <binary file changed>, the proper filtered diff should appear.

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

Screenshots

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions