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

Re: git-rebase -i prunes commits with empty commit-message

From
Michael Haggerty <mhagger@alum.mit.edu>
Date
Mar 10, 2010, 13:13 UTC
Message-ID
<4B979AEF.5010201@alum.mit.edu>
In-Reply-To
<40aa078e1003081207u20046916yda5a62d44ce7a401@mail.gmail.com>
Erik Faye-Lund wrote:
Show 14 quoted lines
> I'm in the process of converting an SVN repo to Git, and in the
> process I found one quite disturbing feature of
> git-rebase--interactive.sh: It discards commits with empty commit
> messages!
> 
> Here's a recepie for reproducing the issue:
> --->8---
> git init
> git commit -m "dummy" --allow-empty
> git commit -m "dummy" --allow-empty
> git commit -m "dummy" --allow-empty
> git filter-branch -f --msg-filter 'sed -e "s/dummy//"'
> git rebase -i HEAD~2
> --->8---

Does git really claim to handle commits with empty commit messages? That you have to use git-filter-branch to create the test case suggests that the answer is "no", but I don't know. (git-commit, for example, refuses to create a commit with an empty message.)

If indeed git requires commit messages to be non-empty, then the fault here seemingly lies with git-filter-branch for allowing commit messages to be completely deleted.

Michael
Previous: Erik Faye-LundNext: Erik Faye-Lund
Message 2 of 6 in “git-rebase -i prunes commits with empty commit-message”
  1. Erik Faye-LundMar 8, 2010
  2. Michael HaggertyMar 10, 2010
  3. Erik Faye-LundMar 10, 2010
  4. Erik Faye-LundMar 11, 2010
  5. Erik Faye-LundMar 11, 2010
  6. Junio C HamanoMar 10, 2010

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.