This is a similar issue I found: Make github use .gitattributes "binary" attribute If it's not intended to work in Github then my question applies to Gitlab only.
So the question: Imagine creating a branch with a single text Dockerfile
and following .gitattributes
:
[core]
whitespace=trailing-space,space-before-tab
[apply]
whitespace=fix
* binary
Dockerfile text=auto diff merge
You push this code, you can view commit in interface and it works just fine.
Then you decide that Dockerfile
should be binary as well (for whatever reason) and remove the last line. You commit it and then make change to the Dockerfile
to check if it works. You call git show
and it shows that changes indeed applied:
pzixe@ZPC MINGW64 ~/Documents/Repos/gitlab-test (all-binary)
$ git show HEAD
commit 141451116e292ae30a515920e6efb906f84b4142 (HEAD -> all-binary, origin/all-binary, github/all-binary)
Author: Psilon <pzixel@gmail.com>
Date: Wed Apr 14 19:25:04 2021 +0300
test changes
diff --git a/Dockerfile b/Dockerfile
index 11f0f66..fef4bc1 100644
Binary files a/Dockerfile and b/Dockerfile differ
But now if you check the github interface you will see that it actually shows a text diff instead of binary diff which was asked:
Then you're trying to see if GitLab is working differently and find out it's not:
So the question is: is there any way to make this working? I'd expect to see a text diff of initial commit 6c0745e
and binary collapsed diff on latest commit 1414511
Here is a repo with reproduced case: https://github.com/Pzixel/test-gitlab