git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Elijah Newren <newren@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Elijah Newren via GitGitGadget <gitgitgadget@gmail.com>,
	Git Mailing List <git@vger.kernel.org>,
	Philippe Blain <levraiphilippeblain@gmail.com>
Subject: Re: [PATCH 2/3] diff: fix filtering of additional headers under --remerge-diff
Date: Wed, 31 Aug 2022 20:38:00 -0700	[thread overview]
Message-ID: <CABPp-BGo6JST9uO-dUEXw1sx6oxCWjBzq9MftLqjcoiFhATMuQ@mail.gmail.com> (raw)
In-Reply-To: <xmqq7d2odp8m.fsf@gitster.g>

On Wed, Aug 31, 2022 at 3:26 PM Junio C Hamano <gitster@pobox.com> wrote:
>
> "Elijah Newren via GitGitGadget" <gitgitgadget@gmail.com> writes:
>
> > 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?

They usually are added to an existing filepair, but as your last
question alludes to, there isn't always one that exists.

One example where this can happen is with a modify/delete conflict.
If someone got one of those and decided to keep the modified file
as-is when resolving the conflict, then there'd be no content diff to
show for that file when investigating the resulting merge commit with
--remerge-diff.  But since the point of --remerge-diff is to show
whatever work the user did to resolve conflicts, and that file was
conflicted, we want to show _something_ for that path.  Thus the
reason for creating a new "phoney" filepair just for attaching the
"remerge CONFLICT (modify/delete) ..." notice.

  reply	other threads:[~2022-09-01  3:38 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-31  6:21 [PATCH 0/3] Output fixes for --remerge-diff Elijah Newren via GitGitGadget
2022-08-31  6:21 ` [PATCH 1/3] diff: have submodule_format logic avoid additional diff headers Elijah Newren via GitGitGadget
2022-08-31 22:20   ` Junio C Hamano
2022-09-01  3:44     ` Elijah Newren
2022-08-31  6:21 ` [PATCH 2/3] diff: fix filtering of additional headers under --remerge-diff Elijah Newren via GitGitGadget
2022-08-31 22:26   ` Junio C Hamano
2022-09-01  3:38     ` Elijah Newren [this message]
2022-08-31  6:21 ` [PATCH 3/3] diff: fix filtering of merge commits " Elijah Newren via GitGitGadget
2022-09-01  1:13 ` [PATCH 0/3] Output fixes for --remerge-diff Junio C Hamano
2022-09-01  3:47   ` Elijah Newren
2022-09-01  4:01     ` Elijah Newren
2022-09-01 15:24     ` Junio C Hamano
2022-09-01 18:46       ` Ævar Arnfjörð Bjarmason
2022-09-01 19:54         ` Junio C Hamano
2022-09-01  7:08 ` [PATCH v2 " Elijah Newren via GitGitGadget
2022-09-01  7:08   ` [PATCH v2 1/3] diff: have submodule_format logic avoid additional diff headers Elijah Newren via GitGitGadget
2022-09-01 16:30     ` Junio C Hamano
2022-09-01  7:08   ` [PATCH v2 2/3] diff: fix filtering of additional headers under --remerge-diff Elijah Newren via GitGitGadget
2022-09-01  7:08   ` [PATCH v2 3/3] diff: fix filtering of merge commits " Elijah Newren via GitGitGadget
2022-09-02  3:53   ` [PATCH v3 0/3] Output fixes for --remerge-diff Elijah Newren via GitGitGadget
2022-09-02  3:53     ` [PATCH v3 1/3] diff: have submodule_format logic avoid additional diff headers Elijah Newren via GitGitGadget
2022-09-02  3:53     ` [PATCH v3 2/3] diff: fix filtering of additional headers under --remerge-diff Elijah Newren via GitGitGadget
2022-09-02  3:53     ` [PATCH v3 3/3] diff: fix filtering of merge commits " Elijah Newren via GitGitGadget

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABPp-BGo6JST9uO-dUEXw1sx6oxCWjBzq9MftLqjcoiFhATMuQ@mail.gmail.com \
    --to=newren@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=gitster@pobox.com \
    --cc=levraiphilippeblain@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).