na-ka-na / ExcelCompare

Command line tool (and API) for diffing Excel Workbooks
820 stars 102 forks source link

`fatal: external diff died, stopping at` error when using with git #30

Open srustamo opened 8 years ago

srustamo commented 8 years ago

The fatal: external diff died, stopping at Project_A.xls appears when using excel_cmp attribute for git diff. This seems like an expected behavior, perhaps a more graceful exiting could be used. Any ideas?

The setup is similar to this: ~/.gitconfig

[diff "xls"]
binary = true
command = ~/bin/ExcelCompare/bin/excel_cmp

~/.config/git/attributes

*.xls diff=xls
na-ka-na commented 8 years ago

Someone pointed out in #29 that it is working for them. Can you download 0.6.0 release https://github.com/na-ka-na/ExcelCompare/releases/download/0.6.0/ExcelCompare-0.6.0.zip and see if it works for you?

andebor commented 8 years ago

I just installed the 0.6.0 release and see the same error as mentioned. My configuration is practically identical. The diff is working fine, but the error message is always present at the bottom.

na-ka-na commented 8 years ago

Ok I will it out and report back.

andebor commented 8 years ago

Great! Let me know if you need me to test anything.

alexlin0 commented 7 years ago

I hit this problem as well using 0.6.1. I read that when git uses an external diff tool that the return code from the diff program is treated as a program exit code, not a diff exit code. Git interprets a return of 0 as no error and anything else as an error.

I worked around this by creating a new excel_cmp_git shell script that returns zero if diff return code is either 0 or 1. Other return codes are returned as is.

#!/bin/sh
java -ea -Xmx512m -cp "/usr/local/Cellar/excel-compare/0.6.1/libexec/*" com.ka.spreadsheet.diff.SpreadSheetDiffer "$@"
rc=$?
if [ $rc == 0 -o $rc == 1 ]; then
    exit 0 ;
else
    exit $rc ;
fi