Re: [PATCH 2/3] diff: fix filtering of additional headers under --remerge-diff
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 31, 2022, 22:26 UTC
- Message-ID
- <xmqq7d2odp8m.fsf@gitster.g>
- In-Reply-To
- <feac97494600e522125b7bb202f4dc5ca020ca99.1661926908.git.gitgitgadget@gmail.com>
"Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com> writes:
Show 9 quoted lines
> From: Elijah Newren <newren@gmail.com>
>
> Commit 95433eeed9 ("diff: add ability to insert additional headers for
> paths", 2022-02-02) introduced the possibility of additional headers.
> Because there could be conflicts with no content differences (e.g. a
> modify/delete conflict resolved in favor of taking the modified file
> as-is), that commit also modified the diff_queue_is_empty() and
> diff_flush_patch() logic to ensure these headers were included even if
> there was no associated content diff.In the longer term, I think we may have to redo the way additional headers are inserted to the diff_queue. All the diff code I am familiar with (read: written before this hack was introduced) trusts that diff_queue.nr is the number of paths that are returned by the diff frontend, and unless there is diffcore_break involved, there will be at most one diff_filepair that is about a path.
Why do these need to be separate entries in the queue, not a new attribute added to an existing filepair? Are we inserting pieces of information that are not about any paths that are involved in the diff?