git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
TLTom Tanner (BLOOMBERG/ LONDON) <ttanner2@bloomberg.net>
Date
Aug 12, 2016, 07:13 UTC
Message-ID
<57AD772501C207A400390148_0_15304@p057>
For instance, if you set your diff/mergetool to meld and you don't have it installed:
> git difftool

Viewing (1/1): 'blah' Launch 'meld' [Y/n]? y /home/ttanner/bin/meld[8]: /opt/swt/bin/meld: not found

> echo $?
0
> /home/ttanner/bin/meld
/home/ttanner/bin/meld[8]: /opt/swt/bin/meld: not found
> echo $?
127
or
> env DISPLAY=wibble git difftool

Viewing (1/1): blah' Launch 'xxdiff' [Y/n]? y xxdiff: cannot connect to X server wibble

> echo $?
0
> env DISPLAY=wibble xxdiff thisfile thatfile
xxdiff: cannot connect to X server wibble
> echo $?

1 and this one (with DISPLAY unset because it was being run elsewhere)

> git mergtool
Normal merge conflict for 'blah: 
{local}: modified file 
{remote}: modified file 
Could not find ':' in DISPLAY: yeah, right 
XIO: fatal IO error 73 (Connection reset by peer) on X server "server:66.0" 
after 0 requests (0 known processed) with 0 events remaining. 
> echo $?

0 which last looked like a successful merge to a script, because it returned 0.

Next: John Keeping
Message 1 of 5 in “git difftool and git mergetool aren't returning errors when the tool has issues”
  1. Tom Tanner (BLOOMBERG/ LONDON)Aug 12, 2016
  2. John KeepingAug 13, 2016
  3. difftool: always honor "command not found" exit codeJohn Keeping, Aug 13, 2016
  4. Junio C HamanoAug 14, 2016
  5. David AguilarAug 13, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.