You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Unable to diff a file with specific diff function #15974
I am unable to diff a zip file (or any with diff=... in .gitattributes).
I set the command in the config (.git/config) file with
[diff "zip"]
textconv = unzip -v
Then in the .gitattributes located in the root of my repository I specified : *.zip diff=zip
When checking for a diff in Github Desktop, it doesn't load anything and prints an error in the developer tools window
Nothing interesting in the log file.
I tried with other stuff, as diff=astextplain but the same thing happens
Also to note that it works with the command line git commands
Release version
Version 3.1.4 (x64)
Operating system
Windows 11 x64
Steps to reproduce the behavior
Clean repo with zip file
.gitattributes with : *.zip diff=zip
./.git/config contains the diff :
[diff "zip"]
textconv = unzip -v
Edit zip file
Check diff in Github Desktop for the zip file
No diff loaded, infinite loading. Developer tools shows the following error
After some debugging I found that the program exits at the line 135 of /app/src/lib/git/spawn.ts.
But I do not get any descriptive message in the console, however, the stderr contained the information I needed : unzip -v: line 1: unzip: command not found\nfatal: unable to read files to diff\n
So my issue just was that the command I set for the textconv was invalid (even though it works for the cmd-line git). To fix it, I added C:\Program Files\Git\usr\bin to the PATH variable.
It could maybe be possible to also print the stderr instead of just printing the default error message (spawn.ts:135) with something like log.error(stderr.toString());
Activity
esseivan commentedon Jan 26, 2023
After some debugging I found that the program exits at the line 135 of /app/src/lib/git/spawn.ts.
But I do not get any descriptive message in the console, however, the stderr contained the information I needed :
unzip -v: line 1: unzip: command not found\nfatal: unable to read files to diff\nSo my issue just was that the command I set for the textconv was invalid (even though it works for the cmd-line git). To fix it, I added
C:\Program Files\Git\usr\binto the PATH variable.It could maybe be possible to also print the stderr instead of just printing the default error message (spawn.ts:135) with something like
log.error(stderr.toString());tidy-dev commentedon Jan 27, 2023
Thanks for doing that debugging. I am going to close this out since it sounds like you found a resolution. :)