git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] rerere: demonstrate a weakness with identical conflicts in different files

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 12, 2010, 02:50 UTC
Message-ID
<7vfwykv92a.fsf@alter.siamese.dyndns.org>
In-Reply-To
<7vmxssvi2t.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
> Hmm, my knee-jerk reaction was that something may be keying off of the
> conflict ids to keep track of which ones are dealt with and which ones are
> yet to be resolved, but I don't recall any part of the implementation that
> would do something like that offhand.  Sorry.

Heh, what was I thinking. Yes, rr-cache/ database keys off of the conflict id, so if your repository has more than one contents that produce exactly the same conflict, say F and G, then, most likely:

 * You see one of them first, say F, record preimage.F and record its
   resolution as postimage.F
 * You encounter conflict G; record it in thisimage, try three-way merge
   between postimage.F and that using preimage.F as the common ancestor.
   If this doesn't work (and it likely doesn't), rerere punts.

Note that this issue can happen even when the trees you are currently merging have only content derived from G and nothing related to F, as their resolutions share the same conflict id.

I vaguely recall discussing this with you here and bringing up a possibile solution for a situation like this; keep sets of <preimage, postimage> (starting from the current {pre,post}image adding {pre,post}image.1, {pre,post}image.2 and so on). When we see a new conflict (after a mergy operation before "rerere" resolves it), try to run the three-way merge with it and each pair, and if we don't find anything that successfully merges, record it as a new half of the pre-post pair, incrementing the counter, and record a new resolution to complete the new pair for later use.

We also need to split "thisimage" into multiple ones in case this happens in a single tree (i.e. contents derived from F and from G are both present and produce the conflict in the same merge).

Previous: Junio C HamanoNext: Johannes Sixt
Message 3 of 4 in “rerere: demonstrate a weakness with identical conflicts in different files”
  1. rerere: demonstrate a weakness with identical conflicts in different filesJohannes Sixt, Aug 11, 2010
  2. Junio C HamanoAug 11, 2010
  3. Junio C HamanoAug 12, 2010
  4. Johannes SixtAug 12, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.