git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Conrad Irwin <conrad.irwin@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Automatically identifying the "split" point of a merged branch.
Date: Sat, 30 Jul 2011 23:53:10 -0600	[thread overview]
Message-ID: <20110731055310.GA14384@sigill.intra.peff.net> (raw)
In-Reply-To: <CAOTq_ptov+6ixvyVvK3iuDp4L-=9PtKES14O93kL9n6hUz0JHA@mail.gmail.com>

On Sat, Jul 30, 2011 at 05:54:59PM -0700, Conrad Irwin wrote:

> I wanted to introduce this branch onto master to end up with:
> 
> A-o-o-o-o-o-o-o-o-o-E-----------N (master)
>  \                   \         /
>   \                   C'-o-o-D' (topic-rebased)
>    \
>     o-o-B-o-o-o-o-M-o-o(integration)
>          \       /
>           C-o-o-D (topic)
> 
> (ASCII art reproduced at http://dpaste.org/GUmM/ lest it be munged)
> 
> While it's easy to create comit N once I have commit D' (with git
> merge --no-ff), I found that it's not at all easy to work out where
> commit B is in order to do do a rebase --onto master B.

If you know M, then B is the merge-base of M^1 and M^2 (i.e., the
parents of M). If you don't know M, but do know D, you can find it by
walking backwards from "integration" until you find a merge commit with
D as its second parent (e.g., by grepping "rev-list --parents").

Make sense?

-Peff

  reply	other threads:[~2011-07-31  5:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-31  0:54 Automatically identifying the "split" point of a merged branch Conrad Irwin
2011-07-31  5:53 ` Jeff King [this message]
2011-07-31  6:08   ` Conrad Irwin

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=20110731055310.GA14384@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=conrad.irwin@gmail.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).