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

Re: Idea for rebase strategy

From
Junio C Hamano <junkio@cox.net>
Date
Nov 27, 2006, 09:26 UTC
Message-ID
<7vfyc5i6k4.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<456AA9B2.8050409@shadowen.org>
Andy Whitcroft <apw@shadowen.org> writes:
Show 13 quoted lines
>> 
>>        A---B---C---D---E topic
>>       /       /
>>   ---X---o---Y---Z master
>>                   \
>>                    A'--B'--C'--D' topic'
>
> Interestingly this trivial situation seems to works pretty much as is.
> A "git rebase --onto master X topic" (at least in my trivial test case)
> replayed A and B, squashed C as a noop, and copied D and E.  I did not
> need any information from the reflog.  Of course the reflog is a good
> way to find X as its first transaction but I did not need it to drive
> replay.

That is only because the pictures are showing the degenerated case for simplicity, and the defect that the current rebase does not even look at any merges is hidden by the fact that the merge in the example C becomes no-op in the rebased history. C could be somewhere not between X and Z, in which case replaying the merge becomes necessary. Also when following from E to traverse down the history of topic, at point C, you need to tell which of B or Y are on the topic, and that's where you would rely on ref-log.

Previous: Andy WhitcroftNext: Johannes Schindelin
Message 4 of 5 in “Idea for rebase strategy”
  1. Johannes SchindelinNov 27, 2006
  2. Junio C HamanoNov 27, 2006
  3. Andy WhitcroftNov 27, 2006
  4. Junio C HamanoNov 27, 2006
  5. Johannes SchindelinNov 27, 2006

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.