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

Re: Confusing error message in rebase when commit becomes empty

From
Peter Krefting <peter@softwolves.pp.se>
Date
Jun 13, 2014, 07:25 UTC
Message-ID
<alpine.DEB.2.00.1406130823251.27436@ds9.cixit.se>
In-Reply-To
<CABURp0q1c+75VzMfttDWVXhTFma3g=Tj938J_9i9xhG1yuMpdQ@mail.gmail.com>
Phil Hord:
Show 6 quoted lines
> Did you have a series of three commits being squashed in your to-do
> list?  I mean, did you have a list like this:
>
>   pick ...  do foo
>   squash ...  revert "do foo"
>   squash ...  What I really meant to do.

Yes, that is exactly what I had. Plus an extra commit that I moved to the end, which was originally placed between the "do foo" and "revert do foo" commits (which is why I wasn't 110% sure the combination of the two would produce an empty commit).

Show 6 quoted lines
> Yes, but empty commits are discouraged on some projects.  If you 
> want your "change + revert = empty" commit to appear after the 
> squash, I would expect you would want to use --keep-empty on your 
> inital rebase command.  But I'm not sure that will do what you 
> expected either; it may only keep previously-empty commits during 
> the rebase.

The thing is that I wasn't expecting it to come out empty, as I had another commit to squash into it. That the interim throw-away squashed commit was empty should have been an internal matter to rebase, IMHO.

-- 
\\// Peter - http://www.softwolves.pp.se/
Previous: Phil HordNext: Jeff King
Message 5 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.