Thread (4 messages) flat view 4 messages, 3 authors, 2016-08-14

Re: git difftool and git mergetool aren't returning errors when the tool has issues

From: John Keeping <hidden>
Date: 2016-08-13 10:36:51

On Fri, Aug 12, 2016 at 07:13:41AM -0000, Tom Tanner (BLOOMBERG/ LONDON) wrote:
For instance, if you set your diff/mergetool to meld and you don't have it installed:
quoted
git difftool
Viewing (1/1): 'blah'
Launch 'meld' [Y/n]? y
/home/ttanner/bin/meld[8]: /opt/swt/bin/meld: not found
quoted
echo $?
0
quoted
/home/ttanner/bin/meld
/home/ttanner/bin/meld[8]: /opt/swt/bin/meld: not found
quoted
echo $?
127
Have you looked at the --trust-exit-code option to git-difftool?

It would be nice if there was a way to differentiate between complete
failure and just the diff tool exiting with a non-zero return status
because the files differ, but I'm not sure whether we can do that
reliably.  POSIX uses 127 and 126 as errors that mean the command didn't
run [1] so it may be sensible to to treat those as special values.

[1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_08_02
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help