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

Re: needs merge

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Jan 10, 2006, 05:21 UTC
Message-ID
<Pine.LNX.4.64.0601092356400.25300@iabervon.org>
In-Reply-To
<7vy81reoie.fsf@assigned-by-dhcp.cox.net>
On Sat, 7 Jan 2006, Junio C Hamano wrote:
Show 6 quoted lines
> *1* While I was trying out the above scenario, I noticed that
> resolve strategy does not notice this and ended up picking one
> ancestor at random.  I think this is because case #16 covers
> only the case where the path P is not changed between C and E
> and D and F, and case #11 must pick an ancestor and picks one at
> random.  Daniel, any thoughts on this?

Right; in this case, we really want to use a merge program that takes multiple ancestors and handles the equivalent to case #16 at the hunk level, but we don't have such a program available. Such a program would be able to identify whether case #16 ever actually occurs for a hunk, which is important because there will generally be a bunch of case #11s at the file level, even if there aren't any reverts (if the common ancestors disagreed before, and the two branches both changed the file to something entirely new, with no reverts, either ancestor is correct to use and the merge result will be useful; we only need to be careful if there were reverts somewhere, which leads to the possibility of false sharing between a branch and an ancestor, and thereby to ignoring the revert, and my feeling is that rejecting case #11 with divergant ancestors would lead to too many conflicts to make crossing merges useable).

One possibility, actually, is to steal a trick from the recursive strategy, and have a multi-ancestor merge program which merges all of the ancestors with a merge-style diff (i.e., merge output, but on diff instead of diff3, with all differences being conflicts), and then uses the result as the ancestor for the three-way merge. It seems to me that this would capture the central advantage of the recursive strategy without quite so much work. Or I might be completely wrong; I'm kind of worn out, and may not be thinking clearly.

	-Daniel
*This .sig left intentionally blank*
Previous: Junio C Hamano
Message 3 of 3 in “RE: needs merge”
  1. Brown, LenJan 7, 2006
  2. Junio C HamanoJan 7, 2006
  3. Daniel BarkalowJan 10, 2006

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.