git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Elijah Newren <newren@gmail.com>
To: Alban Gruin <alban.gruin@gmail.com>
Cc: "Jan Alexander Steffens (heftig)" <jan.steffens@gmail.com>,
	Git Mailing List <git@vger.kernel.org>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Phillip Wood <phillip.wood@dunelm.org.uk>
Subject: Re: git rebase fast-forward fails with abbreviateCommands
Date: Fri, 27 Mar 2020 11:39:33 -0700	[thread overview]
Message-ID: <CABPp-BEV0NxMLuM3U8fqECkEB_XHTvLMav1q_TiYveBWrpsr_w@mail.gmail.com> (raw)
In-Reply-To: <a3cc46ca-824d-8cab-e333-83f51a7824ca@gmail.com>

Hi Alban,

On Fri, Mar 27, 2020 at 8:46 AM Alban Gruin <alban.gruin@gmail.com> wrote:
>
> Hi Jan,
>
> +cc Johannes, Elijah, and Phillip.
>
> Le 27/03/2020 à 12:44, Jan Alexander Steffens (heftig) a écrit :
> > Hi,
> >
> > Since 2.26.0 a simple "git rebase" fails to fast-forward a
> > branch, reporting "error: nothing to do."
> >
> > It started to work again after removing my gitconfig. I've
> > reduced it to the following:
> >
> >     git init foo; cd foo
> >     git commit --allow-empty -m foo
> >     git commit --allow-empty -m bar
> >     git checkout -tb foo
> >     git reset HEAD~
> >     git -c rebase.abbreviateCommands=true rebase
> >
>
> Thank you for reporting this bug.
>
> Since git 2.26, the default rebase backend switched from "am" to
> "merge".  So, by default, a todo list is created, even if you can't see it.
>
> In this case, the todo list contains only a `noop', but this command has
> no short form, and is abbreviated with a comment mark.  As there is no
> more commands in the list, the backend will fail with the error "nothing
> to do".
>
> Three approach to fix this:
>
>  1) add an abbreviation to `noop';  this is the simplest fix, and "n" is
> not taken.
>  2) if a command has no short form, do not abbreviate it;  this is
> trivial to do, and should not break anything.

Both sound reasonable to me.

> A third approach would be to change the meaning of an empty buffer, but
> this would break some tests (at least t3404.3) and cause more confusion
> for users than necessary.

Well, "error: nothing to do" probably makes sense if the user
specifies a list of empty commands or sees a list of empty commands
and agrees to pass these to the backend.  But I'm not sure that
message makes sense for implicitly interactive runs as opposed to
explicitly interactive ones.  Perhaps we could change the message to
just be "Already up to date" if the buffer is empty and the run is not
explicitly interactive?


Elijah

  reply	other threads:[~2020-03-27 18:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-27 11:44 git rebase fast-forward fails with abbreviateCommands Jan Alexander Steffens (heftig)
2020-03-27 15:46 ` Alban Gruin
2020-03-27 18:39   ` Elijah Newren [this message]
2020-03-27 18:44     ` Jan Alexander Steffens (heftig)
2020-03-28 12:21     ` Alban Gruin
2020-03-27 21:33   ` Junio C Hamano
2020-03-30 12:42 ` [PATCH v1 0/2] rebase --merge: fix fast forwarding when `rebase.abbreviateCommands' is set Alban Gruin
2020-03-30 12:42   ` [PATCH v1 1/2] sequencer: don't abbreviate a command if it doesn't have a short form Alban Gruin
2020-03-30 17:50     ` Junio C Hamano
2020-03-30 18:15     ` Eric Sunshine
2020-03-30 12:42   ` [PATCH v1 2/2] t3432: test `--merge' with `rebase.abbreviateCommands = true', too Alban Gruin

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=CABPp-BEV0NxMLuM3U8fqECkEB_XHTvLMav1q_TiYveBWrpsr_w@mail.gmail.com \
    --to=newren@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=alban.gruin@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jan.steffens@gmail.com \
    --cc=phillip.wood@dunelm.org.uk \
    /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).