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

Re: [BUG] - git rebase -i performs rebase when it shouldn't?

From
Jeff King <peff@peff.net>
Date
Apr 12, 2010, 01:01 UTC
Message-ID
<20100412010123.GA11051@coredump.intra.peff.net>
In-Reply-To
<201004111954.38156.j6t@kdbg.org>
On Sun, Apr 11, 2010 at 07:54:37PM +0200, Johannes Sixt wrote:
Show 10 quoted lines
> On Sonntag, 11. April 2010, Jeff King wrote:
> > Good point. Originally, we did the rebase directly on the branch, though
> > I'm not sure if we did "checkout $branch && reset $onto" or "branch -f
> > $branch $onto && checkout $branch". These days we operate on a detached
> > HEAD, and we seem to "checkout $onto^0", which should do the
> > optimization you mention.
> 
> But before this "checkout $onto^0" happens, some (all?) variants still 
> do "checkout topic && rev-list upstream..HEAD" instead of just "rev-list 
> upstream..topic".

I don't think this is the case any longer for regular rebase, from my reading of the code and doing a rebase under GIT_TRACE. Grepping the history turns up 0cb0664 (rebase [--onto O] A B: omit needless checkout, 2008-03-15).

But doing an interactive rebase under GIT_TRACE, it looks like it still does the unnecessary checkout.

-Peff
Previous: Johannes SixtNext: Michal Vitecek
Message 8 of 19 in “[BUG] - git rebase -i performs rebase when it shouldn't?”
  1. Eugene SajineApr 9, 2010
  2. Jeff KingApr 10, 2010
  3. Junio C HamanoApr 10, 2010
  4. Jeff KingApr 10, 2010
  5. Johannes SixtApr 10, 2010
  6. Jeff KingApr 11, 2010
  7. Johannes SixtApr 11, 2010
  8. Jeff KingApr 12, 2010
  9. Michal VitecekApr 12, 2010
  10. Johannes SixtApr 12, 2010
  11. Eugene SajineApr 10, 2010
  12. Jeff KingApr 11, 2010
  13. Eugene SajineApr 11, 2010
  14. Eugene SajineApr 12, 2010
  15. Johannes SixtApr 12, 2010
  16. Eugene SajineApr 12, 2010
  17. Johannes SixtApr 12, 2010
  18. Eugene SajineApr 13, 2010
  19. Johannes SixtApr 14, 2010

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.