From: "Shawn O. Pearce" <spearce@spearce.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [Discussion] cherry-picking a merge
Date: Thu, 15 Nov 2007 03:16:49 -0500 [thread overview]
Message-ID: <20071115081648.GK14735@spearce.org> (raw)
In-Reply-To: <7v3av86iqa.fsf@gitster.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> wrote:
> 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>.
Yes.
Then `rebase -i` might be able to learn how to "pick" merge commits.
And then my coworkers can stop bothering me about that. And just
do it themselves.
I used to think of merges as something special. I now really only
look at them as being special *during* the merge process, as you
may need to generate that recursive base. But otherwise its just
"diff M^1..M". So why isn't it?
:-)
--
Shawn.
next prev parent reply other threads:[~2007-11-15 8:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-15 8:00 [Discussion] cherry-picking a merge Junio C Hamano
2007-11-15 8:16 ` Shawn O. Pearce [this message]
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=20071115081648.GK14735@spearce.org \
--to=spearce@spearce.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.