From: Jens Lehmann <Jens.Lehmann@web.de>
To: funeeldy <Marlene_Cote@affirmednetworks.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] git-submodule: Remove duplicate entries during merge with conflict
Date: Fri, 15 Jul 2011 21:27:48 +0200 [thread overview]
Message-ID: <4E2094B4.3090009@web.de> (raw)
In-Reply-To: <1310668419989-6584432.post@n2.nabble.com>
Am 14.07.2011 20:33, schrieb funeeldy:
> How can new users of git submodules learn about merge conflicts? When and
> why they occur, and how to resolve them in a way that doesn't lose commits?
That is pretty similar to merge conflicts in regular files: They happen
when you merge two branches where both sides changed the recorded submodule
commit to another one (and those are not the same). The resolution can be
done by finding a submodule commit that has both changes. In most cases that
will be based on a merge (maybe even a fast forward) with both commits in
its history.
If git finds a fast forward from the merge base to commit1 and commit2
(let's say they both are on master and newer than the merge base), the
newer one is picked automatically. If git finds a single merge from which
both commits are reachable, it proposes that as conflict resolution and
tells you how you can stage that. Only if it doesn't find any or more
than two merges, you are on your own and have to resolve the conflict
manually by finding an appropriate commit.
> If I have to choose my version or their version, that isn't really a merge,
> or is it?
It would be if the merge strategy is "ours" or "theirs". But in most normal
cases you would want to have both commits reachable from the merge result.
next prev parent reply other threads:[~2011-07-15 19:27 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-17 8:09 [PATCH] git-submodule: Remove duplicate entries during merge with conflict Nicolas Morey-Chaisemartin
2011-03-17 18:47 ` Junio C Hamano
2011-03-17 20:50 ` Junio C Hamano
2011-03-21 8:43 ` Nicolas Morey-Chaisemartin
2011-03-21 20:53 ` Jens Lehmann
2011-03-21 20:29 ` Jens Lehmann
2011-03-21 20:59 ` Junio C Hamano
2011-03-21 21:34 ` Nicolas Morey-Chaisemartin
2011-03-21 22:01 ` Jens Lehmann
2011-03-22 6:28 ` Nicolas Morey-Chaisemartin
2011-07-14 18:33 ` funeeldy
2011-07-15 19:27 ` Jens Lehmann [this message]
2011-07-15 20:32 ` Marlene Cote
2011-07-15 21:41 ` Jens Lehmann
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=4E2094B4.3090009@web.de \
--to=jens.lehmann@web.de \
--cc=Marlene_Cote@affirmednetworks.com \
--cc=git@vger.kernel.org \
/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).