Thread (4 messages) 4 messages, 3 authors, 2024-03-08

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

From: Jean-Rémy Falleri <hidden>
Date: 2024-02-15 11:09:50

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)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help