0

I have configured my repository to be able to diff xlsx files making use of a filter called zippey. So far it is working well, but I am only able to diff HEAD vs. Index with the .xlsx file already staged.

zippey works by adding a filter:

  • smudge: git config filter.zippey.smudge "$PWD/zippey.py d"
  • clean: git config filter.zippey.clean "$PWD/zippey.py e"

I have also added a [diff] stanza to .git/config following the advice in https://stackoverflow.com/a/42077620/5364231:

Tante recommended a very simple approach in Managing ZIP-based file formats in Git:

Open your ~/.gitconfig file (create if not existing already) and add the following stanza:

[diff "zip"]  
    textconv = unzip -c -a

But it seems that the filter is applied before the diff, because using the Compare with Unmodified command from Visual Studio Git window:

Visual Studio Compare with Unmodified error window

Visual Studio failed to start to compare tool warning window

However, if I delete the filter and leave only the diff, even though the Compare with Unmodified command still fails, I am able to execute the diff via git bash:

git diff "C:\Users\user1\AppData\Local\Temp\TFSTemp\vctmp14420_631477.TestData.3c61211c.xlsx" $PWD/TestData.xlsx

So my questions are:

  1. Why is the clean filter being applied when comparing files that are not staged?
  2. Can this behaviour be prevented?
  3. Is it possible for the [filter] and [diff] to coexist in this particular case?
  4. Why am I able to git diff files with git bash but not using the Compare with Unmodified command?

Thanks a lot. Regards.

.git/config:
---------------------------------------------------------------------
[filter "zippey"]
  clean = \"C:\\GIT\\zippey.py\" d
  smudge = \"C:\\GIT\\zippey.py\" e
[diff "zip"]
  textconv = \"$PWD\\unzip.exe\" -c -a
CodeWizard
  • 110,388
  • 20
  • 126
  • 153
elgato
  • 427
  • 1
  • 5
  • 17

0 Answers0