git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Automatically identifying the "split" point of a merged branch.

From
Jeff King <peff@peff.net>
Date
Jul 31, 2011, 05:53 UTC
Message-ID
<20110731055310.GA14384@sigill.intra.peff.net>
In-Reply-To
<CAOTq_ptov+6ixvyVvK3iuDp4L-=9PtKES14O93kL9n6hUz0JHA@mail.gmail.com>
On Sat, Jul 30, 2011 at 05:54:59PM -0700, Conrad Irwin wrote:
Show 15 quoted lines
> 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
Previous: Conrad IrwinNext: Conrad Irwin
Message 2 of 3 in “Automatically identifying the "split" point of a merged branch.”
  1. Conrad IrwinJul 31, 2011
  2. Jeff KingJul 31, 2011
  3. Conrad IrwinJul 31, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.