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

Confusing error message in rebase when commit becomes empty

From
Peter Krefting <peter@softwolves.pp.se>
Date
Jun 11, 2014, 12:49 UTC
Message-ID
<alpine.DEB.2.00.1406111321090.6307@ds9.cixit.se>
Hi!

I am rebasing a branch to combine a couple of commits. One is a revert of a previous commit. Since there are commits in-between, I do "squash" to make sure I get everything, and then add the actual change on top of that. The problem is that rebase stops with a confusing error message (from commit, presumably):

   $ git rebase --interactive
   [...]
   You asked to amend the most recent commit, but doing so would make
   it empty. You can repeat your command with --allow-empty, or you can
   remove the commit entirely with "git reset HEAD^".
   rebase in progress; onto 342b22f
   You are currently rebasing branch 'mybranch' on '342b22f'.
   No changes
   Could not apply 4682a1f20f6ac29546536921bc6ea0386441e23e... Revert "something"
OK, so I should retry the command with --allow-empty, then:
   $ git rebase --interactive --allow-empty
   error: unknown option `allow-empty'
Nope, that's not quite right.

Running "git rebase --continue" does work as expected, but perhaps it just shouldn't stop in this case?

-- 
\\// Peter - http://www.softwolves.pp.se/
Next: Phil Hord
Message 1 of 7 in “Confusing error message in rebase when commit becomes empty”
  1. Peter KreftingJun 11, 2014
  2. Phil HordJun 11, 2014
  3. Peter KreftingJun 11, 2014
  4. Phil HordJun 11, 2014
  5. Peter KreftingJun 13, 2014
  6. Jeff KingJun 13, 2014
  7. Jeff KingJun 13, 2014

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.