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

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

From
Conrad Irwin <conrad.irwin@gmail.com>
Date
Jul 31, 2011, 00:54 UTC
Message-ID
<CAOTq_ptov+6ixvyVvK3iuDp4L-=9PtKES14O93kL9n6hUz0JHA@mail.gmail.com>
Hello Gitters,

I wonder if I might pick your brains on the best way to handle a situation I found myself in recently:

We have an integration branch, and a master branch, and a topic branch that was based on the integration branch. Graphically:

A-o-o-o-o-o-o-o-o-o-E-(master)
 \
  o-o-B-o-o-o-o-M-o-o(integration)
       \       /
        C-o-o-D (topic)
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.

My usual approach would be to try and use git merge-base, but because the topic branch is already merged into the integration branch, that doesn't give useful output.

Is there a good way around this?
Conrad
Next: Jeff King
Message 1 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.