Subject: Re: [PATCH] t4013: add expected failure for "log --patch --no-patch"

From: Junio C Hamano <[email-masked]>
Date: Thu, 04 May 2023 11:07:51 -0700

Junio C Hamano <[email-masked]> writes:

> Sergey Organov <[email-masked]> writes:
>
>> --patch followed by --no-patch is to be a no-op according to the "git
>> log" manual page.
>
> I briefly wondered if it is a bug in the documentation.
> ... when "git log -p --raw" shows both patch and raw, I do not
> think of a reason why "git log -p --raw --no-patch" should not
> behave similarly.

So, to tie the loose ends, "log -p --raw --no-patch" and "log -p
--stat --no-patch" do behave similarly.  Where my reaction was
mistaken was that I did not read the manual page myself that clearly
said it is the same as "-s" that suppresses diff output (where "diff
output" is not limited to "patch"---diffstat is also output of "diff"),
and incorrectly thought that "--no-patch" would countermand only
"--patch" and nothing else.

In Documentation/diff-options.txt we have this snippet:

    -s::
    --no-patch::
            Suppress diff output. Useful for commands like `git show` that
            show the patch by default, or to cancel the effect of `--patch`.

I imagine that argument could be made that the last half-sentence
can be read to say that the option is usable ONLY to cancel the
effect of `--patch` without cancelling the effect of anything else.

But that smells like a bit of stretch, as "like" in "commands like"
is a sign, at least to me, that it gives a few examples without
attempting to be exhaustive (meaning that it is too much to read
"ONLY" that is not written in "or to cancel the effect of")..

Here is my attempt to make it tighter to avoid getting mis-read:

    Suppress all output from the diff machinery.  Useful for
    commands like `git show` that show the patch by default to
    squelch their output, or to cancel the effect of options like
    `--patch`, `--stat` earlier on the command line in an alias.