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

Git difftool: interaction between --dir-diff and --trust-exit-code

From
JFJean-Rémy Falleri <jr.falleri@gmail.com>
Date
Feb 15, 2024, 11:09 UTC
Message-ID
<976C9BF2-CB82-429A-B9FA-6A14BCFFCA3D@gmail.com>
Hi all and thanks for the amazing work you do on Git.
It seems that the —trust-exit-code option from git-difftool is not working when one use —dir-diff.
As an example I have set up the following configuration :

[difftool "false"] cmd = false

And when I launch git-difftool in normal mode with —trust-exit-code, it works fine: $ git difftool -y -t false --trust-exit-code HEAD HEAD~1 $ echo $?

> 128

However the same command in dir-diff mode is not working : $ git difftool -t false -d --trust-exit-code HEAD HEAD~1 $ echo $?

> 0
From what I read in git/git-difftool—helper.sh it seems to not forward the exit status when $GIT_DIFFTOOL_DIRDIFF is on.
I believe there is nothing in the documentation about this interaction. Maybe this is intended but I find that this could be useful to have this option working on dir-diff mode too. For instance in my use case I would want to signal an error when I detect breaking changes with the breaking change detector we are working on, that is hooked as a difftool.

Best regards! --- Jean-Rémy Falleri (http://www.labri.fr/~falleri)

Next: Patrick Steinhardt
Message 1 of 10 in “Git difftool: interaction between --dir-diff and --trust-exit-code”
  1. Jean-Rémy FalleriFeb 15, 2024
  2. git-difftool--helper: honor `--trust-exit-code` with `--dir-diff`Patrick Steinhardt, Feb 16, 2024
  3. Junio C HamanoFeb 16, 2024
  4. Patrick SteinhardtFeb 20, 2024
  5. David AguilarFeb 28, 2024
  6. Junio C HamanoFeb 28, 2024
  7. git-difftool--helper: honor `--trust-exit-code` with `--dir-diff`Patrick Steinhardt, Feb 20, 2024
  8. SZEDER GáborMar 8, 2024
  9. Junio C HamanoMar 8, 2024
  10. Patrick SteinhardtMar 21, 2024

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.