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

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.

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.

Thank you again for reporting this.

Cheers,
Alban


  reply	other threads:[~2020-03-27 15:46 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 [this message]
2020-03-27 18:39   ` Elijah Newren
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=a3cc46ca-824d-8cab-e333-83f51a7824ca@gmail.com \
    --to=alban.gruin@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=jan.steffens@gmail.com \
    --cc=newren@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).