* Proposal for new git Merge Strategy
@ 2006-08-23 18:40 Jon Loeliger
2006-08-23 19:02 ` Jakub Narebski
2006-08-23 20:00 ` Junio C Hamano
0 siblings, 2 replies; 4+ messages in thread
From: Jon Loeliger @ 2006-08-23 18:40 UTC (permalink / raw)
To: git; +Cc: mwm
Folks,
The other day, I was talking to some other folks else-list
about git's approach to merges and mentioned that there was
some structure in place to handle different merge strategies.
One person observed that Perforce had a really good
approach to merging and conflict resolution that allowed
user interaction during the process specifically to
help select the individual files and hunks that contributed
to the final result. I confess that I have never used
Perforce, so this is all hear-say and interpretation. :-)
However, it does seem like an approach that we could
easily add to git -- not as the default of course.
(Just think how dead we'd all be if Linus had to manually
interact with every merge he performed at the tip of the
Linux Pyramid. :-)
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?
Thanks,
jdl
PS -- Please keep mwm on the CC: list as he doesn't
directly subscribe to the git list, but would
like to participate in the thread. Thanks!
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: Proposal for new git Merge Strategy 2006-08-23 18:40 Proposal for new git Merge Strategy Jon Loeliger @ 2006-08-23 19:02 ` Jakub Narebski 2006-08-23 20:00 ` Junio C Hamano 1 sibling, 0 replies; 4+ messages in thread From: Jakub Narebski @ 2006-08-23 19:02 UTC (permalink / raw) To: git Jon Loeliger wrote: > The other day, I was talking to some other folks else-list > about git's approach to merges and mentioned that there was > some structure in place to handle different merge strategies. > > One person observed that Perforce had a really good > approach to merging and conflict resolution that allowed > user interaction during the process specifically to > help select the individual files and hunks that contributed > to the final result. I confess that I have never used > Perforce, so this is all hear-say and interpretation. :-) > > However, it does seem like an approach that we could > easily add to git -- not as the default of course. > (Just think how dead we'd all be if Linus had to manually > interact with every merge he performed at the tip of the > Linux Pyramid. :-) > > 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. And select which files are which (after renaming, copying, etc.) > Any thoughts down this line? Good idea? Bad idea? Wouldn't it be better to fallback to graphical/user guided merger only on _failed_ merge? Merge helpers like xxdiff, Meld or KDiff3 http://git.or.cz/gitwiki/InterfacesFrontendsAndToolsWishlist There was proposal of git script which run xxdiff with correct extracted files, if I remeber correctly postponed waiting for more generic version. -- Jakub Narebski Warsaw, Poland ShadeHawk on #git ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Proposal for new git Merge Strategy 2006-08-23 18:40 Proposal for new git Merge Strategy Jon Loeliger 2006-08-23 19:02 ` Jakub Narebski @ 2006-08-23 20:00 ` Junio C Hamano 2006-08-23 23:05 ` Martin Langhoff 1 sibling, 1 reply; 4+ messages in thread From: Junio C Hamano @ 2006-08-23 20:00 UTC (permalink / raw) To: Jon Loeliger; +Cc: git Jon Loeliger <jdl@jdl.com> writes: > 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. ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Proposal for new git Merge Strategy 2006-08-23 20:00 ` Junio C Hamano @ 2006-08-23 23:05 ` Martin Langhoff 0 siblings, 0 replies; 4+ messages in thread From: Martin Langhoff @ 2006-08-23 23:05 UTC (permalink / raw) To: Junio C Hamano; +Cc: Jon Loeliger, git On 8/24/06, Junio C Hamano <junkio@cox.net> wrote: > Jon Loeliger <jdl@jdl.com> writes: ... > > 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. I've been slack on my reading of the list lately so totally missed out on that thread. I'll go and read it now... ... > 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. I still think that the default initial behaviour git has is right. Most conflicts are trivial, and people can deal with conflict markers just right. It's what we are used to. Except when it's a mess and it's unclear what goes where and why. That's when git log --merge and my git-xxdiff help. I've also been wondering if I can do gitk --merge easily ;-) > 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. My implementation doesn't use the 3 stages either, just because I didn't see xxdiff giving any stage a particular meaning. I should rework it to have the 3 stages there, and trust users to read the filename, which should say 'ancestor'. In terms of the one script or many, if there is concensus on OneScriptToRuleThemAll, I am not that opposed to reworking it to something like git-mergehelper --tool xxdiff path/to/file.c with a big switch statement inside the script :-p What bothers me is that there may be interesting parameters to pass to the invoked tool, and other than having a stupid '--toolopts' passthrough, we are pretty fsck'd. By having separate git-xxdiff, git-meld, etc the git- scripts would accept all/most of the same params that the tool accepts, therefore feeling "natural" to users of the tool. A definite advantage, IMHO. {Ugh, my implementation doesn't get that far. But hey, good intentions!} cheers, martin ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-08-23 23:06 UTC | newest] Thread overview: 4+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2006-08-23 18:40 Proposal for new git Merge Strategy Jon Loeliger 2006-08-23 19:02 ` Jakub Narebski 2006-08-23 20:00 ` Junio C Hamano 2006-08-23 23:05 ` Martin Langhoff
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).