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

Re: Proposal for new git Merge Strategy

From
Junio C Hamano <junkio@cox.net>
Date
Aug 23, 2006, 20:00 UTC
Message-ID
<7vsljngr34.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<E1GFxeZ-0000Nw-ED@jdl.com>
Jon Loeliger <jdl@jdl.com> writes:
Show 8 quoted lines
> But for complex or critical merges, a "guided merge"
> strategy seems like it might be a useful tool.  Basically,
> it would offer options to select Stage 1 or Stage 2
> revisions, or step in and offer hunks from Stage 1 and 2,
> revert to "ours" or "theirs", or "revert to 'ours' or 'theirs'
> for all remaining files".  Things like that maybe.
>
> Any thoughts down this line?  Good idea?  Bad idea?

We had some discussion on this with Catalin in "Unresolved issues #3" thread, regarding git-xxdiff (did I ever take it? I liked it for what it does, but I was not sure about its odd-man-out-ness) which was proposed by Martin Langhoff.

A merge that results in manual fixups conceptually take these steps:

 - revs involved in 3-way merge identified with git-merge-base;
 - read-tree is given these three bases;
 - git-merge-index gives three stages as individual temporary
   files to git-merge-one-file for each path that cannot be
   resolved at tree-level.
   - git-merge-one-file calls "merge" (reminds me that I should
     replace this with "diff3").

We should be able to make the part that call "merge/diff3" to alternatively call xxdiff or its friends (kompare, emerge, pick your favorites). Catalin even showed us a code snippet used in StGIT for this in the thread.

Martin's proposed tool git-xxdiff is meant to be invoked after all of the above still left conflict markers. As Catalin pointed out, using "xxdiff -U" to work on a file with conflict markers is less powerful than working on three stages directly, but on the other hand it can be used as the last stage fixup, independent from what git-merge does internally. In other words, it is meant to help solving the same problem but in a different part of the workflow.

Previous: Jakub NarebskiNext: Martin Langhoff
Message 3 of 4 in “Proposal for new git Merge Strategy”
  1. Jon LoeligerAug 23, 2006
  2. Jakub NarebskiAug 23, 2006
  3. Junio C HamanoAug 23, 2006
  4. Martin LanghoffAug 23, 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.