Re: [PATCH v2 1/3] diff: have submodule_format logic avoid additional diff headers
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 1, 2022, 16:30 UTC
- Message-ID
- <xmqqedwvawhj.fsf@gitster.g>
- In-Reply-To
- <aea0bbc1c6a33d62f6b3313d56664d53df8f620a.1662016087.git.gitgitgadget@gmail.com>
"Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com> writes:
As there is no guarantee that we'd never add another hack to use a different kind of "phoney" filepair to diff_queue for another purpose, either the name of the helper function, or a comment in front of it, should say something that is sufficient to help readers understand ...
Show 11 quoted lines
> +static int diff_filepair_is_phoney(struct diff_filespec *one,
> + struct diff_filespec *two)
> +{
> + return !DIFF_FILE_VALID(one) && !DIFF_FILE_VALID(two);
> +}
> ...
> - if (!DIFF_FILE_VALID(one) && !DIFF_FILE_VALID(two)) {
> + if (diff_filepair_is_phoney(one, two)) {
> /*
> * We should only reach this point for pairs from
> * create_filepairs_for_header_only_notifications(). For... some of what this comment said, i.e. the pair that was added by create_filepairs_for_header_only_notifications() is what the helper detects.
Other than that, the whole series looks good.