From: Junio C Hamano <gitster@pobox.com> To: Alban Gruin <alban.gruin@gmail.com> Cc: "SZEDER Gábor" <szeder.dev@gmail.com>, git@vger.kernel.org, "Elijah Newren" <newren@gmail.com>, "Ævar Arnfjörð" <avarab@gmail.com>, "Eugeniu Rosca" <erosca@de.adit-jv.com>, "Jeff King" <peff@peff.net>, "Eugeniu Rosca" <roscaeugeniu@gmail.com>, "Phillip Wood" <phillip.wood@dunelm.org.uk>, "Johannes Schindelin" <Johannes.Schindelin@gmx.de> Subject: Re: [PATCH v3] rebase -i: stop checking out the tip of the branch to rebase Date: Fri, 24 Jan 2020 10:30:48 -0800 [thread overview] Message-ID: <xmqqk15g1zc7.fsf@gitster-ct.c.googlers.com> (raw) In-Reply-To: <20200124150500.15260-1-alban.gruin@gmail.com> (Alban Gruin's message of "Fri, 24 Jan 2020 16:05:00 +0100") Alban Gruin <alban.gruin@gmail.com> writes: > On big repositories, it's a performance penalty: with `rebase -i', the > user may have to wait before editing the todo list while git is > extracting the branch silently, and "quiet" rebases will be slower than > `am'. > > Since we already have the oid of the tip of the branch in > `opts->orig_head', it's useless to switch to this commit. > ... > Before this patch: > > $ time git rebase -m --onto v4.18 463fa44eec2fef50~ 463fa44eec2fef50 > > real 0m8,940s > user 0m6,830s > sys 0m2,121s > > After this patch: > > $ time git rebase -m --onto v4.18 463fa44eec2fef50~ 463fa44eec2fef50 > > real 0m1,834s > user 0m0,916s > sys 0m0,206s > > Reported-by: SZEDER Gábor <szeder.dev@gmail.com> > Signed-off-by: Alban Gruin <alban.gruin@gmail.com> > --- Good. > diff --git a/sequencer.c b/sequencer.c > index b9dbf1adb0..4dc245d7ec 100644 > --- a/sequencer.c > +++ b/sequencer.c > @@ -3715,20 +3715,6 @@ static int run_git_checkout(struct repository *r, struct replay_opts *opts, > return ret; > } > > -int prepare_branch_to_be_rebased(struct repository *r, struct replay_opts *opts, > - const char *commit) > -{ > - const char *action; > - > - if (commit && *commit) { > - action = reflog_message(opts, "start", "checkout %s", commit); > - if (run_git_checkout(r, opts, commit, action)) > - return error(_("could not checkout %s"), commit); > - } > - > - return 0; > -} > - > static int checkout_onto(struct repository *r, struct replay_opts *opts, > const char *onto_name, const struct object_id *onto, > const char *orig_head) > diff --git a/sequencer.h b/sequencer.h > index 9f9ae291e3..74f1e2673e 100644 > --- a/sequencer.h > +++ b/sequencer.h > @@ -190,9 +190,6 @@ void commit_post_rewrite(struct repository *r, > const struct commit *current_head, > const struct object_id *new_head); > > -int prepare_branch_to_be_rebased(struct repository *r, struct replay_opts *opts, > - const char *commit); > - > #define SUMMARY_INITIAL_COMMIT (1 << 0) > #define SUMMARY_SHOW_AUTHOR_DATE (1 << 1) > void print_commit_summary(struct repository *repo, Nice to see this helper to go. Thanks.
next prev parent reply other threads:[~2020-01-24 18:30 UTC|newest] Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-01-08 21:43 Unreliable 'git rebase --onto' Eugeniu Rosca 2020-01-08 22:35 ` SZEDER Gábor 2020-01-09 0:55 ` Elijah Newren 2020-01-09 15:03 ` SZEDER Gábor 2020-01-09 17:53 ` Elijah Newren 2020-01-21 19:18 ` [PATCH v1] rebase -i: stop checking out the tip of the branch to rebase Alban Gruin 2020-01-21 20:07 ` Elijah Newren 2020-01-22 20:24 ` Junio C Hamano 2020-01-22 20:47 ` Junio C Hamano 2020-01-24 14:45 ` Alban Gruin 2020-01-24 14:45 ` [PATCH v2] " Alban Gruin 2020-01-24 14:55 ` Alban Gruin 2020-01-24 18:12 ` Junio C Hamano 2020-01-24 15:05 ` [PATCH v3] " Alban Gruin 2020-01-24 18:30 ` Junio C Hamano [this message] 2020-02-05 14:31 ` Johannes Schindelin 2020-01-24 17:11 ` [PATCH v2] " Andrei Rybak 2020-01-09 11:13 ` Unreliable 'git rebase --onto' Eugeniu Rosca [not found] ` <CABPp-BHsyMOz+hi7EYoAnAWfzms7FRfwqCoarnu8H+vyDoN6SQ@mail.gmail.com> 2020-01-09 10:53 ` Eugeniu Rosca 2020-01-09 18:05 ` Elijah Newren 2020-01-10 0:06 ` Eugeniu Rosca 2020-01-10 2:35 ` Elijah Newren
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=xmqqk15g1zc7.fsf@gitster-ct.c.googlers.com \ --to=gitster@pobox.com \ --cc=Johannes.Schindelin@gmx.de \ --cc=alban.gruin@gmail.com \ --cc=avarab@gmail.com \ --cc=erosca@de.adit-jv.com \ --cc=git@vger.kernel.org \ --cc=newren@gmail.com \ --cc=peff@peff.net \ --cc=phillip.wood@dunelm.org.uk \ --cc=roscaeugeniu@gmail.com \ --cc=szeder.dev@gmail.com \ --subject='Re: [PATCH v3] rebase -i: stop checking out the tip of the branch to rebase' \ /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
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).