Re: [PATCH v2 3/3] diff: let external diffs report that changes are uninteresting

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 06.06.24 um 08:39 schrieb Johannes Sixt:
> Am 05.06.24 um 10:38 schrieb René Scharfe:
>> +diff.trustExitCode::
>> +	If this boolean value is set to true then the `diff.external`
>> +	command is expected to return exit code 1 if it finds
>> +	significant changes and 0 if it doesn't, like diff(1).  If it's
>> +	false then the `diff.external` command is expected to always
>> +	return exit code 0.  Defaults to false.
>
> I find this somewhat unclear. What are the consequences when this value
> is set to false, but the command exits with code other than 0? Is it
>
>     If it's false then any exit code other than 0 of the `diff.external`
>     command is treated as an error.

Yes, unexpected exit codes are reported as errors.

If trustExitCode is false and --quiet is given then the execution of
external diffs is skipped, so in that situation there is no exit code to
expect, though.  Not sure how to express it concisely, though.  This
attempt looks a bit bloated:

--quiet::
        Disable all output of the program. Implies `--exit-code`.
        Disables execution of external diff helpers whose exit code
        is not trusted, i.e. their respective configuration option
	`diff.trustExitCode` or `diff.<driver>.trustExitCode` or
	environment variable `GIT_EXTERNAL_DIFF_TRUST_EXIT_CODE` is
	false.

Might be worth documenting this original behavior somehow, anyway.  It
makes sense in hindsight, but surprised me a bit when I wrote the tests.

René





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux