Re: [PATCH 1/3] rebase: teach rebase --keep-base
- From
Denton Liu <liu.denton@gmail.com>
- Date
- Mar 25, 2019, 00:06 UTC
- Message-ID
- <20190325000618.GB9384@archbookpro.localdomain>
- In-Reply-To
- <xmqqtvfso1cz.fsf@gitster-ct.c.googlers.com>
Hi Junio,
On Sun, Mar 24, 2019 at 10:20:28PM +0900, Junio C Hamano wrote:
Show 43 quoted lines
> Denton Liu <liu.denton@gmail.com> writes:
>
> > A common scenario is if a user is working on a topic branch and they
> > wish to make some changes to intermediate commits or autosquashing, they
> > would run something such as
> >
> > git rebase -i --onto master... master
> >
> > in order to preserve the merge base. This prevents unnecessary commit
> > churning.
> >
> > Alternatively, a user wishing to test individual commits in a topic
> > branch without changing anything may run
> >
> > git rebase -x ./test.sh master... master
> >
> > Since rebasing onto the merge base of the branch and the upstream is
> > such a common case, introduce the --keep-base option as a shortcut.
> >
> > This allows us to rewrite the above as
> >
> > git rebase -i --keep-base master
> >
> > and
> >
> > git rebase -x ./test.sh --keep-base master
> >
> > respectively.
>
> I never use the "feature" myself, but I recall that when "git
> rebase" is run on a branch appropriately prepared, you do not even
> have to say <upstream> (iow, you type "git rebase<RET>" and rebase
> on top of @{upstream}).
>
> Can this new "--keep-base" feature mesh well with it? When the
> current branch has forked from origin/master, for example, it would
> be good if
>
> $ git rebase -i --same-base
>
> becomes a usable short-hand for
>
> $ git rebase -i --same-base origin/masterBy "--same-base", I am assuming you mistyped and meant to write "--keep-base"? If that's the case, I can make it a shorthand.
Thanks,
Denton
Show 5 quoted lines
> > aka > > $ git rebase -i --onto $(git merge-base HEAD origin/master) origin/master >