From: Jay Soffian <jaysoffian@gmail.com>
To: Joshua Jensen <jjensen@workspacewhiz.com>
Cc: "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: Sharing a massive distributed merge
Date: Thu, 17 Mar 2011 01:21:19 -0400 [thread overview]
Message-ID: <AANLkTim0TL5X8rKoBceK3nLA4JrtuftqkJDkRi0Lok0A@mail.gmail.com> (raw)
In-Reply-To: <4D8119BE.2090208@workspacewhiz.com>
On Wed, Mar 16, 2011 at 4:12 PM, Joshua Jensen
<jjensen@workspacewhiz.com> wrote:
> We have two codelines that diverged quite a while back, and we are now
> bringing them back together. More than 800 files are in conflict, but it is
> very possible that the automatic non-conflicting merge is not correcting.
> This means thousands of files need to be examined.
Have you considered breaking this up into multiple merges, so that
each merge deals with only a subset of the conflicts? This may mean
more work overall, but makes reviewing each individual merge much more
tenable.
IOW, given a history like:
a--b--c--d--e...z
\
1--2--3--4...25
Instead of trying to merge z into 25, first merge b, then c, etc. I'd
try a divide and conquer approach - merge half way back to the common
ancestor, it that's too big, go half way back again, etc.
This obviously doesn't parallelize the effort.
> Git doesn't support distribution of a merge (although that would be
> extraordinarily cool), so the next best thing seemed to be force adding all
> files with conflict markers and then committing the merge. We then publish
> the conflicting branch and have each person fix their files. Given that the
> conflict markers are already in place, they can't use their favorite
> graphical merge tool.
Well, this is awful, but you could do something like:
for x in conflicted_files:
git show :1:$x > $x.base
git show :3:$x > $x.theirs
git checkout --ours $x
git add $x.base $x.theirs $x
Commit that, then folks can use their favorite merge tools, commit the
result, and remove the .base and .theirs.
Notes:
- I'd do all this work on its own branch. When all the files have been
resolved, then do a real merge, but consult the branch for the
conflict resolution, e.g. "git merge ...; git checkout
merge_resolution -- ."
- See git-mergetool.sh for how to use checkout-index instead of "show
:<stage>:..."
- This only handles modify/modify conflicts.
- You might want to use "merge.conflictstyle diff3" and commit that
file too so that there's a reference file with the conflict markers --
I find the diff3 style very helpful in addition to GUI mergetools, for
which I've not found one that does a good presentation of theirs,
ours, base, and resolved.
> What I want to be able to do is have each person perform the merge locally,
> stage only the files they care about in that session, reset all other files,
> and commit as a regular commit, not a merge commit. The user can take
> advantage of whatever tools they want in the in progress merge. When
> everyone has finished this process, we run git merge and keep our local
> changes.
$ git merge --squash other_branch
# resolve foo
$ git commit -m "resolved foo" -- foo
$ git reset --hard
Though I think the "awful" solution above might prove less error prone
and do a better job of keeping track of the remaining work.
j.
next prev parent reply other threads:[~2011-03-17 5:21 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-16 20:12 Sharing a massive distributed merge Joshua Jensen
2011-03-17 5:21 ` Jay Soffian [this message]
2011-03-17 6:38 ` Jeff King
2011-03-17 7:04 ` Jay Soffian
2011-03-17 7:30 ` Jeff King
2011-03-18 5:49 ` Jeff King
2011-03-24 3:03 ` Joshua Jensen
2011-03-17 8:53 ` Alex Riesen
2011-03-17 14:10 ` Jay Soffian
2011-03-17 14:54 ` Alex Riesen
2011-03-17 17:58 ` Jay Soffian
2011-03-17 18:48 ` Alex Riesen
2011-03-17 19:15 ` Jeff King
2011-03-17 19:53 ` Alex Riesen
2011-03-17 20:54 ` Junio C Hamano
[not found] ` <10061287.5697.1300343903667.JavaMail.trustmail@mail1.terreactive.ch>
2011-03-17 7:51 ` Where do all the tips go? (Was: Re: Sharing a massive distributed merge) Victor Engmark
2011-03-17 8:01 ` Jeff King
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=AANLkTim0TL5X8rKoBceK3nLA4JrtuftqkJDkRi0Lok0A@mail.gmail.com \
--to=jaysoffian@gmail.com \
--cc=git@vger.kernel.org \
--cc=jjensen@workspacewhiz.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).