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

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

From
Conrad Irwin <conrad.irwin@gmail.com>
Date
Jul 31, 2011, 06:08 UTC
Message-ID
<CAOTq_psXsjipBxcG+86bQvPwQj866iAf_c9nQJ=KvjCjYHtySg@mail.gmail.com>
In-Reply-To
<20110731055310.GA14384@sigill.intra.peff.net>
On Sat, Jul 30, 2011 at 10:53 PM, Jeff King <peff@peff.net> wrote:
Show 8 quoted lines
> On Sat, Jul 30, 2011 at 05:54:59PM -0700, Conrad Irwin wrote:
>
> 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?
Yup. git rev-list was definitely the tool I was missing, thank you :).
Conrad
merge=$(git rev-list --parents integration |\
                 grep " $(git rev-parse topic)" | cut -d' ' -f 1)
split=$(git merge-base $merge^ $merge^2)
git rebase --onto master $split
git checkout master
git merge --no-ff topic
Previous: Jeff King
Message 3 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.