From: Junio C Hamano Date: Fri, 05 May 2023 16:31:04 GMT Subject: Re: [PATCH] diff: fix behaviour of the "-s" option Message-ID: In-Reply-To: <87sfcbyy8c.fsf@osv.gnss.ru> Sergey Organov writes: >> * 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.