Search code examples
gitbinaryfilesxlsgit-extensions

git extension and *.xls


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


Solution

  • 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.