[webkit-dev] WebCore has moved: How to avoid merge conflicts
Evan Martin
evan at chromium.org
Tue Jan 11 16:40:59 PST 2011
On Tue, Jan 11, 2011 at 4:28 PM, Adam Barth <abarth at webkit.org> wrote:
> I'm going to defer to git experts here. I tested some git scenarios
> when moving JavaScriptGlue and they seemed to work more-or-less
> automagically, but WebCore might be different due to its size.
I believe that if "git diff -M point-where-you-branched-from
origin/master" spots the files as renames, then merge will handle the
renames. And that otherwise you're out of luck.
> I moved the WebCore directory in one atomic "svn move" operation with
> zero changes, which should help git understand what happened.
Git only tracks content, not diffs -- when doing a merge I'm pretty
sure it only considers the two points you're merging and an ancestor
(with some extra complexities when there are multiple candidate
ancestors that don't come up for WebKit's linear history). So extra
intermediate commits won't help.
If you run into trouble, you might try doing two merges: one up to the
point where the files were renamed, then a follow-up to tip of tree.
Linus has historically emphasized that the merge tools should be
relatively stupid (aka predictable), and that the interesting this is
that they're always fast and will remain correct in the future after
you've resolved the current confusion. (Just sharing my understanding
of it, not agreeing with it.)
Disclaimer: the above is just my understanding as an enthusiast and
could be totally wrong.
More information about the webkit-dev
mailing list