-
Notifications
You must be signed in to change notification settings - Fork 354
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
馃殌 use diff-compatible exit statuses that differ between difference-found and error #1584
Comments
Hi @calestyo, I thought that it worked like that already! Can you post an example? This is MacOS in zsh.
|
Indeed. Not sure how I produced the contradicting result.... I've been calling Sorry for the noise. btw: Is there a way in |
No worries.
You mean, keep all the reformatting and decorations but specifically disable colour? I don't think there is a way to do that, although perhaps there are enough colour settings in delta to achieve it piecemeal! So in a script the answer would be not to call delta if one only wants the raw git/diff input, and of course, git doesn't invoke delta at all if output is not a tty. But if you explicitly pipe to delta in a script then it will add colours and text decorations / reformatting. |
I reproduced it... wait a second... |
If I do however:
|
Ah-ha, I'm not at my computer but I do remember that the code handling process substitutions had to do something unfortunate. Feel free to investigate! |
There are more cases:
all give Also:
Though it works when comparing with an existent file (not sure, btw. whether it should even then, cause then there's still one inaccessible file - the target of the dangling symlink). |
Also when doing using a directory as existent file:
|
That issue may even go yet a bit further. Assume I do:
(and there is a difference)
I get the differences shown, but exit status is |
That's right, in |
Well unless for the other cases mentioned above, where one does have |
Hey.
It seems right now, that
delta
has an exit status of0
in case no differences were found, and one of1
either when differences were found or an error (e.g. file not found) occurred.It would be nice if one could differ between the latter two, ideally following POSIX' exit statuses for diff, that is:
Thanks,
Chris.
The text was updated successfully, but these errors were encountered: