Re: [PATCH 3/5] rebase: factor out merge_base calculation
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Aug 16, 2022, 09:15 UTC
- Message-ID
- <77899422-7o79-s730-p529-72022r6o7442@tzk.qr>
- In-Reply-To
- <xmqqczd12zhv.fsf@gitster.g>
Hi Junio,
On Mon, 15 Aug 2022, Junio C Hamano wrote:
Show 13 quoted lines
> "Phillip Wood via GitGitGadget" <gitgitgadget@gmail.com> writes: > > > From: Phillip Wood <phillip.wood@dunelm.org.uk> > > > > Separate out calculating the merge base between onto and head from the > > check for whether we can fast-forward or not. This means we can skip > > the fast-forward checks when the rebase is forced and avoid > > calculating the merge-base twice when --keep-base is given. > > > > Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk> > > --- > > Note the unnecessary braces around "if (keep_base)" are added here > > reduce the churn on the next commit.
This note...
Show 12 quoted lines
> > @@ -1668,7 +1678,11 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
> > die(_("Does not point to a valid commit '%s'"),
> > options.onto_name);
> > }
> > -
> > + if (keep_base) {
> > + oidcpy(&merge_base, &options.onto->object.oid);
> > + } else {
> > + fill_merge_base(&options, &merge_base);
> > + }
>
> No need for braces around single-statement block on either side.... already addresses this feedback.
Ciao, Dscho