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

time needed to rebase shortend by using --onto?

From
Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date
May 26, 2021, 10:09 UTC
Message-ID
<20210526100932.2hw4rbazgvd6mzff@pengutronix.de>
Hello,

I have a kernel topic branch containing 4 patches on top of Linux v5.4. (I didn't speak to the affected customer, so I cannot easily share the patch stack. If need be I can probably anonymize it or ask if I can publish the patches.)

It rebases clean on v5.10:
	$ time git rebase v5.10
	Performing inexact rename detection: 100% (36806539/36806539), done.
	Performing inexact rename detection: 100% (36806539/36806539), done.
	Performing inexact rename detection: 100% (36806539/36806539), done.
	Performing inexact rename detection: 100% (36806539/36806539), done.
	Successfully rebased and updated detached HEAD.
	real	3m47.841s
	user	1m25.706s
	sys	0m11.181s

If I start with the same rev checked out and explicitly specify the merge base, the rebase process is considerably faster:

	$ time git rebase --onto v5.10 v5.4
	Performing inexact rename detection: 100% (36806539/36806539), done.
	Performing inexact rename detection: 100% (36806539/36806539), done.
	Performing inexact rename detection: 100% (36806539/36806539), done.
	Performing inexact rename detection: 100% (36806539/36806539), done.
	Successfully rebased and updated detached HEAD.
	real	1m20.588s
	user	1m12.645s
	sys	0m6.733s

Is there some relevant complexity in the first invocation I'm not seeing that explains it takes more than the double time? I would have expected that

	git rebase v5.10
does the same as:
	git rebase --onto v5.10 $(git merge-base HEAD v5.10)
. (FTR:
	$ time git merge-base HEAD v5.10
	219d54332a09e8d8741c1e1982f5eae56099de85
	real	0m0.158s
	user	0m0.105s
	sys	0m0.052s
, 219d5433 is v5.4 as expected.
	$ git version
	git version 2.29.2
That's from the Debian package 1:2.29.2-1~bpo10+1 on a Debian 10 box.)

Best regards Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |
Next: Bagas Sanjaya
Message 1 of 12 in “time needed to rebase shortend by using --onto?”
  1. Uwe Kleine-KönigMay 26, 2021
  2. Bagas SanjayaMay 26, 2021
  3. Elijah NewrenMay 26, 2021
  4. Uwe Kleine-KönigMay 27, 2021
  5. Uwe Kleine-KönigMay 27, 2021
  6. Elijah NewrenMay 28, 2021
  7. Elijah NewrenMay 27, 2021
  8. Uwe Kleine-KönigMay 28, 2021
  9. Elijah NewrenMay 28, 2021
  10. Felipe ContrerasMay 29, 2021
  11. Junio C HamanoMay 26, 2021
  12. Uwe Kleine-KönigMay 27, 2021

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.