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

Re: Rebasing cascading topic trees

From
NKNorbert Kiesel <nkiesel@gmail.com>
Date
Nov 17, 2016, 00:12 UTC
Message-ID
<CAM+g_Ns-9Sj5r0V2XXZfGQz+0XiO1O-hT03japEGibkNgh8a4A@mail.gmail.com>
In-Reply-To
<xmqq7f83ouqs.fsf@gitster.mtv.corp.google.com>
Yes, `git rebase --onto topic1 topic1@{1} topic2` is the answer!
Thanks so much, learned something new today.
On Wed, Nov 16, 2016 at 3:44 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 40 quoted lines
> Norbert Kiesel <nkiesel@gmail.com> writes:
>
>> I currently have a situation with cascading topic branches that I need to rebase
>> regularly.  In the picture below, I want to rebase the tree starting with `E` to
>> be rebased onto master (my actually cascade is 4 branches deep).
>>
>> A--B--C--D (master)
>>    \
>>     E--F (topic1)
>>        \
>>         G--H (topic2)
>>
>> After running `git rebase --onto master master topic1`, I end up with
>>
>> A--B--C--D (master)
>>    |     \
>>    \      E'--F' (topic1)
>>     E--F
>>        \
>>         G--H (topic2)
>>
>> I then need to also run `git rebase --onto topic1 F topic2` to arrive at the
>> desired
>>
>> A--B--C--D (master)
>>    |     \
>>    \      E'--F' (topic1)
>>     E--F      \
>>        |       G'--H' (topic2)
>>        \
>>         G--H
>>
>> Problem here is that I don't have a nice symbolic name for `F` anymore after the
>> first rebase. Rebasing `topic2` first is not really possible, because I do not
>> have a new graft-point yet.  I currently write down `F` ahead of time (or use
>> `reflog` if I forgot) `F`, but I wonder if there is a better solution.
>
> Doesn't topic1@{1} point at "F" after the rebase of the topic1
> finishes?
>
Previous: Junio C HamanoNext: Jeff King
Message 3 of 5 in “Rebasing cascading topic trees”
  1. Norbert KieselNov 16, 2016
  2. Junio C HamanoNov 16, 2016
  3. Norbert KieselNov 17, 2016
  4. Jeff KingNov 17, 2016
  5. Norbert KieselNov 17, 2016

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.