Subject: Re: [PATCH v4] add-patch: response to unknown command

From: Junio C Hamano <[email-masked]>
Date: Mon, 29 Apr 2024 09:09:09 -0700

Phillip Wood <[email-masked]> writes:

> There is also a practical argument against using "git diff" to
> generate the expected output as it only works if the diff contains a
> single hunk. If the diff contains more than one hunk "add -p" displays
> them separately.

True, but spliting the output from "git diff" at @@ hunk boundary
lines would allow you to hardcode the assumption that "add -p" shows
each hunk exactly as "git diff" would.  So if we really wanted to
have the convenience that the tests' expectation automatically
follow what "git diff" of the day happens to produce, it is still a
viable approach to use "git diff" output with some post-processing.

Thanks.