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

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

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 24, 2020, 18:12 UTC
Message-ID
<xmqqv9p0206p.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<9221098c-cba4-5db5-5870-bf6af721c448@gmail.com>
Alban Gruin <alban.gruin@gmail.com> writes:
> Forget this patch, I forgot to clearly say that the `am' backend is not
> affected.

The phrase "is not affected" makes it sound like "Do not worry, I made sure it is not broken by this patch", but I do not think that is the more important part ;-).

The shared codepath for all types of rebase before dispatching already knew what commit at the tip of the branch being rebased is, but the sequencer-based backend was doing unnecessary work to figure it out again by checking it out. And this patch is about fixing that, isn't it?

So I do not think singling out 'am' is a good use of readers' time. The first paragraph can be further tweaked why the extra checkout is unneeded.

    Before dispatching the control to one of the individual rebase
    backends, the shared codepath in "rebase" figures out what
    branch is being rebased, because it is necessary to compute the
    range of commits to replay to run any backend.  The rebase
    backend based on the sequencer machinery (used for '-i', '-r'
    and '-m') however computed this commit range by actually
    checking out the branch and reading HEAD, which was unnecessary,
    as the working tree is then immediately gets reset to that of
    the commit on which rebased history is built (aka "onto"
    commit).
or something along the line, perhaps?

With this patch applied, the wasteful prepare_branch_to_be_rebased() has no caller, and the patch removes it from sequencer.[ch] as well, which is very good.

Previous: Alban GruinNext: Alban Gruin
Message 13 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.