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

Re: rebase vs rebase -i

From
Jay Soffian <jaysoffian@gmail.com>
Date
Feb 5, 2010, 01:20 UTC
Message-ID
<76718491002041720y104c0778s8614fea5e9038905@mail.gmail.com>
In-Reply-To
<7vmxzose72.fsf@alter.siamese.dyndns.org>
On Thu, Feb 4, 2010 at 7:45 PM, Junio C Hamano <gitster@pobox.com> wrote:
> I think Dscho's point is that cherry-pick internally runs the same
> merge-recursive.
Ah hah, that's what I was missing. Thank you.
Show 11 quoted lines
> When you have a change C based on its parent C^ and want to replay that
> effect on a (possibly unrelated) commit A, you would run three-way merge,
> merging C into A as if C^ is the common ancestor.  The rebase script
> cherry-pick, and revert all work with the same principle (for revert
> obviously you would swap C and C^---you are applying the effect of going
> from C to C^ in that case).
>
> And no, "format-patch --stdout | am -3" pipe in the normal rebase codepath
> will stay unless you can produce a benchmark that says the performance of
> merge machinery is good enough these days.  Back when "rebase -m" was
> introduced, it wasn't.

Indeed, the difference is painful on a largish tree (910M after gc --aggressive, 39k files). Best of 3 runs for each of these:

$ time git rebase --onto HEAD~11 HEAD~10 First, rewinding head to replay your work on top of it... [...] real 0m11.164s user 0m2.671s sys 0m4.836s

$ time git rebase -m --onto HEAD~11 HEAD~10 [...] real 0m40.507s user 0m17.848s sys 0m16.052s

$ time GIT_EDITOR="sed -i -e 1d" git rebase -i HEAD~11 [...] real 0m27.758s user 0m12.615s sys 0m13.134s

It looks like there's room for improvement to rebase -m. (2.53 Ghz Core 2 Duo Macbook Pro, 4GB memory.)

j.
Previous: Junio C Hamano
Message 10 of 10 in “rebase vs rebase -i”
  1. Jay SoffianFeb 4, 2010
  2. Johannes SchindelinFeb 4, 2010
  3. Jay SoffianFeb 4, 2010
  4. Johannes SchindelinFeb 4, 2010
  5. Jay SoffianFeb 4, 2010
  6. Johannes SchindelinFeb 4, 2010
  7. Jay SoffianFeb 4, 2010
  8. Junio C HamanoFeb 5, 2010
  9. Junio C HamanoFeb 5, 2010
  10. Jay SoffianFeb 5, 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.