git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: git@vger.kernel.org, entwicklung@pengutronix.de
Subject: Re: time needed to rebase shortend by using --onto?
Date: Thu, 27 May 2021 07:18:52 +0900	[thread overview]
Message-ID: <xmqqim35b0kz.fsf@gitster.g> (raw)
In-Reply-To: <20210526100932.2hw4rbazgvd6mzff@pengutronix.de> ("Uwe Kleine-König"'s message of "Wed, 26 May 2021 12:09:32 +0200")

Uwe Kleine-König <u.kleine-koenig@pengutronix.de> writes:

> 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)

There is a voodoo called fork-point detection that walks back the
reflogs and repeatedly computes merge bases, and giving --onto to
explicitly give a commit on which the history is transplanted should
remove the need to do the computation, so that is a possibility.

But according to the manpage, it should not kick in for invocations
in the above example that specify the <upstream> (the
rebase.forkpoint configuration variable can clobber this default).

  parent reply	other threads:[~2021-05-26 22:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-26 10:09 time needed to rebase shortend by using --onto? Uwe Kleine-König
2021-05-26 11:04 ` Bagas Sanjaya
2021-05-26 14:38 ` Elijah Newren
2021-05-27 21:59   ` Uwe Kleine-König
2021-05-27 22:15     ` Uwe Kleine-König
2021-05-28  5:38       ` Elijah Newren
2021-05-27 23:08     ` Elijah Newren
2021-05-28 21:40       ` Uwe Kleine-König
2021-05-28 22:26         ` Elijah Newren
2021-05-29 16:59         ` Felipe Contreras
2021-05-26 22:18 ` Junio C Hamano [this message]
2021-05-27 22:16   ` Uwe Kleine-König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqim35b0kz.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=entwicklung@pengutronix.de \
    --cc=git@vger.kernel.org \
    --cc=u.kleine-koenig@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).