git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git rebase fast-forward fails with abbreviateCommands

From
Alban Gruin <alban.gruin@gmail.com>
Date
Mar 27, 2020, 15:46 UTC
Message-ID
<a3cc46ca-824d-8cab-e333-83f51a7824ca@gmail.com>
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 :
Show 15 quoted lines
> 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

Previous: Jan Alexander Steffens (heftig)Next: Elijah Newren
Message 2 of 11 in “git rebase fast-forward fails with abbreviateCommands”
  1. Jan Alexander Steffens (heftig)Mar 27, 2020
  2. Alban GruinMar 27, 2020
  3. Elijah NewrenMar 27, 2020
  4. Jan Alexander Steffens (heftig)Mar 27, 2020
  5. Alban GruinMar 28, 2020
  6. Junio C HamanoMar 27, 2020
  7. 0/2 rebase --merge: fix fast forwarding when `rebase.abbreviateCommands' is setAlban Gruin, Mar 30, 2020
  8. 1/2 sequencer: don't abbreviate a command if it doesn't have a short formAlban Gruin, Mar 30, 2020
  9. Junio C HamanoMar 30, 2020
  10. Eric SunshineMar 30, 2020
  11. 2/2 t3432: test `--merge' with `rebase.abbreviateCommands = true', tooAlban Gruin, Mar 30, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.