From: Junio C Hamano <gitster@pobox.com>
To: git@vger.kernel.org
Subject: [Discussion] cherry-picking a merge
Date: Thu, 15 Nov 2007 00:00:45 -0800 [thread overview]
Message-ID: <7v3av86iqa.fsf@gitster.siamese.dyndns.org> (raw)
Earlier "git cherry-pick" learned the "-m <parent-number>"
option to allow cherry-picking a merge commit.
When you have this history:
---o---o---C---A---M
\ /
o---o-------B
You can replay the change between A and M (in other words, the
effect of merging B into A) on top of C to create a new commit,
with:
$ git cherry-pick -m 1 M
In the current implementation, the resulting commit has a single
parent C. This is quite similar to a squash merge of B into C.
When you think about it, as long as the topological relationship
between A and B is very similar to that of C and B (iow,
"merge-base A B" and "merge-base C B" are the same), the effect
should be the same as a real merge between B and C, shouldn't it?
---o---o---C---A---M
\ \ /
o---o---\---B
\ \
`---X
I am wondering if it makes sense to record the result of
"cherry-pick -m" as a real merge between the current HEAD and
all the other parents of the cherry-picked merge except the one
that is named with the <parent-number>.
next reply other threads:[~2007-11-15 8:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-15 8:00 Junio C Hamano [this message]
2007-11-15 8:16 ` [Discussion] cherry-picking a merge Shawn O. Pearce
2007-11-15 17:40 ` Junio C Hamano
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=7v3av86iqa.fsf@gitster.siamese.dyndns.org \
--to=gitster@pobox.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).