git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How to create patches for a merge?
@ 2010-02-18 11:40 Geoffrey Lee
  2010-02-18 18:10 ` Junio C Hamano
  2010-02-18 20:37 ` Jeff King
  0 siblings, 2 replies; 5+ messages in thread
From: Geoffrey Lee @ 2010-02-18 11:40 UTC (permalink / raw)
  To: git

When I use "git format-patch", it doesn't seem to include merges. How
can I perform a merge and then e-mail it to someone as a set of
patches?

For example, let's say that I merge two branches and perform another
commit on top of the merge:

git init

echo "initial file" > test.txt
git add test.txt
git commit -m "Commit A"

git checkout -b foo master
echo "foo" > test.txt
git commit -a -m "Commit B"

git checkout -b bar master
echo "bar" > test.txt
git commit -a -m "Commit C"

git merge foo
echo "foobar" > test.txt
git commit -a -m "Commit M"

echo "2nd line" >> test.txt
git commit -a -m "Commit D"

This creates the following tree:

    B
  /   \
A       M - D
  \   /
    C

Now I try to checkout the initial commit and replay the above changes:

git checkout -b replay master
git format-patch --stdout master..bar | git am -3

This produces a merge conflict. In this scenario, "git format-patch
master..bar" only produces 3 patches, omitting "Commit M". How do I
deal with this?

-Geoffrey Lee

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-02-20 17:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-18 11:40 How to create patches for a merge? Geoffrey Lee
2010-02-18 18:10 ` Junio C Hamano
2010-02-18 20:37 ` Jeff King
2010-02-19 10:25   ` Geoffrey Lee
2010-02-20 17:39     ` Clemens Buchacher

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).