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

Re: [PATCH v1] rebase -i: stop checking out the tip of the branch to rebase

From
Alban Gruin <alban.gruin@gmail.com>
Date
Jan 24, 2020, 14:45 UTC
Message-ID
<4142ab55-3311-4be2-2173-5cdacafb17f3@gmail.com>
In-Reply-To
<xmqq5zh36wx1.fsf@gitster-ct.c.googlers.com>
Hi Junio,
Le 22/01/2020 à 21:47, Junio C Hamano a écrit :
Show 19 quoted lines
> Alban Gruin <alban.gruin@gmail.com> writes:
> 
>> One of the first things done by the interactive rebase is to make a todo
>> list.  This requires knowledge of the commit range to rebase.  To get
>> the oid of the last commit of the range, the tip of the branch to rebase
>> is checked out with prepare_branch_to_be_rebased(), then the oid of the
>> HEAD is read.  On big repositories, it's a performance penalty: the user
>> may have to wait before editing the todo list while git is extracting the
>> branch silently (because git-checkout is silenced here).  After this,
>> the head of the branch is not even modified.
> 
> Hmph.  One curious thing in the above is why this is specific to
> "rebase -i". The need to know the commit range to rebase is shared
> across any rebase backend, and it would be the most natural to parse
> the optional second argument (i.e. the branch or the commit to
> rebase) before builtin/rebase.c dispatches to a specific rebase
> backend, wouldn't it?  So, the question is why a normal "rebase"
> does not need the same fix?
> 

That's a problem shared by all rebases using the sequencer, so -m and -r are also affected by this. `am' is not.

Show 5 quoted lines
> If the answer is "rebase in general was fine without extra checkout,
> but 'rebase -i' was doing an unnecessary checkout" (or any other
> answer) that is something that would help future readers to record
> in the commit log message.
> 

So yes, the answer is that the am backend does not perform this checkout, unlike all others rebases.

I will resend this patch very soon.
> Thanks.
> 
> 

Cheers, Alban

Previous: Junio C HamanoNext: Alban Gruin
Message 10 of 22 in “Unreliable 'git rebase --onto'”
  1. Eugeniu RoscaJan 8, 2020
  2. SZEDER GáborJan 8, 2020
  3. Elijah NewrenJan 9, 2020
  4. SZEDER GáborJan 9, 2020
  5. Elijah NewrenJan 9, 2020
  6. rebase -i: stop checking out the tip of the branch to rebaseAlban Gruin, Jan 21, 2020
  7. Elijah NewrenJan 21, 2020
  8. Junio C HamanoJan 22, 2020
  9. Junio C HamanoJan 22, 2020
  10. Alban GruinJan 24, 2020
  11. rebase -i: stop checking out the tip of the branch to rebaseAlban Gruin, Jan 24, 2020
  12. Alban GruinJan 24, 2020
  13. Junio C HamanoJan 24, 2020
  14. rebase -i: stop checking out the tip of the branch to rebaseAlban Gruin, Jan 24, 2020
  15. Junio C HamanoJan 24, 2020
  16. Johannes SchindelinFeb 5, 2020
  17. Andrei RybakJan 24, 2020
  18. Eugeniu RoscaJan 9, 2020
  19. Eugeniu RoscaJan 9, 2020
  20. Elijah NewrenJan 9, 2020
  21. Eugeniu RoscaJan 10, 2020
  22. Elijah NewrenJan 10, 2020

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.