5

we are using git at win7 with gitExtension. Time to time we need work with excel sheets. I have edited .gitattributes and .git/config according: Git Diff Indent/Pretty Print/Beautify Before Diff

and as a convertor I am using VBS script (it is obased on: http://developer.rhino3d.com/guides/rhinoscript/reading-excel-files/ ) with cscript.exe

When in gitExtension run: Git bash and command: git diff file.xls it shows me changes as I expect. But in extension I can see that file.xls is changed but comparison like git diff is missing. There is nothing - only empty window. Before editing .gitattributes and .git/config it shows (in this window) that it is binary file and it is changed.

Can anybody help me how to set Git extension to show text interpretation (according vbs script) content of xls-file and diffs too.

After few comments I am adding printscreen of Git bash - you can see that here it some how works (mabye there is problem with some special characters which are shown in console as < D8 > or ^M) enter image description here

And another printscreen form Extension - there is nothing enter image description here

I have also looked into git-extension command log. There I can see that it use command:

git diff --unified=3 -- TCs/pokusna_tabulka.xls

which in git bash works

fik236
  • 83
  • 6
  • You could check in the [commandline log](https://stackoverflow.com/a/20432014/2303202) which exactly command it runs. If it still produces different result I woudl suspect some low-level issues like buffering. – max630 Mar 29 '18 at 10:11
  • So, did I get it right, that you run the `git show ` for some commit, and open the very same commit in GtExtensions, and see different result? – max630 Mar 29 '18 at 10:16
  • I'm not sure that the command used by Gitextensions to display the diff support "diff driver". Perhaps you should open an issue on the project repository: https://github.com/gitextensions/gitextensions/issues/ Not related but I found a link that could help you also : http://programmaticallyspeaking.com/git-diffing-excel-files.html – Philippe Mar 29 '18 at 10:58
  • Echoing @Philippe - please raise an issue with details at our GH tracker – RussKie Mar 31 '18 at 10:35

1 Answers1

1

I created an entry on the ext extenstions repo: https://github.com/gitextensions/gitextensions/issues/4865

Edit: I have found a workaround.

  1. In your repo, create a .gitattributes with the entries: *.xls diff=excel *.xlsx diff=excel

  2. In your repo in /.git/config write: [diff "excel"] textconv = C:/ExcelDiff2/command/xdoc2txt.exe

textconv must point to a tool that can convert xls files to text. Git extension will then take both xls files, convert them and diff them.

Mao
  • 56
  • 1
  • 6
  • It is working now - problem was that I have used in /.git/config relative path; When I have used absolute its start works - Thanks! – fik236 Apr 25 '18 at 07:53