All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Henrie <alexhenrie24@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Git mailing list" <git@vger.kernel.org>,
	"Denton Liu" <liu.denton@gmail.com>,
	"Eric Sunshine" <sunshine@sunshineco.com>,
	"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>,
	"Johannes Schindelin" <Johannes.Schindelin@gmx.de>
Subject: Re: [PATCH] rebase: use correct base for --keep-base when a branch is given
Date: Wed, 20 Apr 2022 22:38:49 -0600	[thread overview]
Message-ID: <CAMMLpeTLkg7=WwhpkpA53bQ5ucSPH3zTXRdhR7uj9OKA=7s=kw@mail.gmail.com> (raw)
In-Reply-To: <xmqqh76no53x.fsf@gitster.g>

On Wed, Apr 20, 2022 at 2:46 PM Junio C Hamano <gitster@pobox.com> wrote:
>
> It is surprising that a basic and trivial bug was with us forever.

I was also surprised. Like you, I dug through the mailing list
archives and my impression was that the code review was mostly
concerned about the case where there are multiple merge bases. No one
seemed to have read the man page closely enough to notice that 'git
rebase --keep-base <upstream> <branch>' cannot be equivalent to 'git
rebase --onto <upstream>... <upstream>' because the latter doesn't
have <branch> at all. Seeing that discrepancy is what prompted me to
try out what actually happens when the branch is specified on the
command line, and then I realized that it was more than just a
documentation error.

> > +test_expect_success 'rebase --keep-base main topic from main' '
> > +     git reset --hard &&
>
> Clearing whatever cruft the last test left is good, but ...
>
> > +     git checkout topic &&
> > +     git reset --hard G &&
> > +     git checkout main &&
>
> it would be more efficient to just do
>
>         git checkout main &&
>         git branch -f topic G &&
>
> no?  Instead of rewriting the working tree three times, you only
> need to do so once here.

Sure. I'll make that change.

-Alex

  reply	other threads:[~2022-04-21  4:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-18  1:27 [PATCH] rebase: use correct base for --keep-base when a branch is given Alex Henrie
2022-04-20 20:46 ` Junio C Hamano
2022-04-21  4:38   ` Alex Henrie [this message]
2022-04-21  4:42 ` [PATCH v2] " Alex Henrie

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='CAMMLpeTLkg7=WwhpkpA53bQ5ucSPH3zTXRdhR7uj9OKA=7s=kw@mail.gmail.com' \
    --to=alexhenrie24@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=liu.denton@gmail.com \
    --cc=sunshine@sunshineco.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.