Re: [PATCH] diff: fix behaviour of the "-s" option
From: Junio C Hamano <hidden>
Date: 2023-05-05 16:31:09
From: Junio C Hamano <hidden>
Date: 2023-05-05 16:31:09
Sergey Organov [off-list ref] writes:
quoted
* Whenever we set DIFF_FORMAT_FOO becasuse we saw the "--foo" option (e.g. DIFF_FORMAT_RAW is set when the "--raw" option is given), we make sure we drop DIFF_FORMAT_NO_OUTPUT. We forgot to do so in some of the options and caused (2) above. * When processing "-s" option, we should not just set DIFF_FORMAT_NO_OUTPUT bit, but clear other DIFF_FORMAT_* bits. We didn't do so and retained format bits set by options previously seen, causing (1) above.Sounds good to me. Doesn't this makes DIFF_FORMAT_NO_OUTPUT obsolete as well, I wonder, as absence of any output bits effectively means "no output"?
Not quite. The latter is not "set 0 to output_format word", but "set 0 to output_format word and then flip only NO_OUTPUT bit on". I've written a bit more on it in a follow-up message to the patch. Thanks.