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

Re: request for documentation about branch surgery

From
Daniel Barkalow <barkalow@iabervon.org>
Date
Jul 7, 2009, 18:28 UTC
Message-ID
<alpine.LNX.2.00.0907071400170.2147@iabervon.org>
In-Reply-To
<200907070105.12821.bruno@clisp.org>
On Tue, 7 Jul 2009, Bruno Haible wrote:
Show 12 quoted lines
> 6) Also, it would be good to have a section "Reconnecting branches after rebase".
>    If you want to reconnect a branch to a rebased master, here's how to do it:
> 
>                    /--C'--...---P'--Q'--...---Z'  new rebased master
>               A---B---C---...---P---Q---...---Z   old master
>                                  \
>                                   --BA---...---BZ  release-branch
> 
>   =>
>               A---B---C'--...---P'--Q'--...---Z'  new rebased master
>                                  \
>                                   --BA---...---BZ  release-branch
This is impossible; the parent of BA is P, not P'.
                   /--C'--...---P'--Q'--...---Z'  new rebased master
              A---B---C---...---P---Q---...---Z   old master
                                 \
                                  --BA---...---BZ  release-branch
  =>
                                  --BA'--...---BZ' release branch
                                 /
                   /--C'--...---P'--Q'--...---Z'  new rebased master
              A---B---C---...---P---Q---...---Z
                                 \
                                  --BA---...---BZ

In order to draw well-formed tree sequences, you can only add items to the trees, and only use each letter once in the whole thing. When you've got a complete history following those rules, you can elide parts of the history that aren't referenced any more, but you still can't reuse their letters.

You're drawing some of your trees as if it were possible to have commits that are not eq but are equal; in fact, all information about a commit, including its parentage, is immutable and contributes to the way it is referenced, so any equal commits are eq (and therefore only appear in one spot on the graph).

	-Daniel
*This .sig left intentionally blank*
Previous: Junio C Hamano
Message 10 of 10 in “request for documentation about branch surgery”
  1. Bruno HaibleJul 6, 2009
  2. Elijah NewrenJul 7, 2009
  3. Elijah NewrenJul 7, 2009
  4. Bruno HaibleJul 7, 2009
  5. Andreas EricssonJul 7, 2009
  6. Junio C HamanoJul 7, 2009
  7. Bruno HaibleJul 7, 2009
  8. Andreas EricssonJul 7, 2009
  9. Junio C HamanoJul 7, 2009
  10. Daniel BarkalowJul 7, 2009

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.