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

Re: [PATCH] Fix amending of a commit with an empty message

From
Alex Riesen <raa.lkml@gmail.com>
Date
Feb 21, 2008, 21:32 UTC
Message-ID
<20080221213204.GC20143@steel.home>
In-Reply-To
<7vmyput4dn.fsf@gitster.siamese.dyndns.org>
Junio C Hamano, Thu, Feb 21, 2008 21:56:52 +0100:
Show 9 quoted lines
> Alex Riesen <raa.lkml@gmail.com> writes:
> 
> > In this one. I am a bit unsure regarding the change (it looks a little
> > too strong), even though it passes the test suite.
> 
> I think that is because your new test is faulty.
> 
> Instead of ':' I complained about, try having "echo foo" there.
> I think it will still fail.
Oh, indeed. The commit to amend does not introduce any changes.
Show 6 quoted lines
> Having said that, here is a quiz.  When the user says "git
> commit --amend", what are the valid reasons not to allow it,
> other than:
> 
>  - the index is unmerged.
>  - the branch is yet to be born.

There are no tree changes in the commit to be amended. And if there is a strong wish to do just the amendment, there is always --allow-empty.

Ok, it must have been the amount of err... tee I just had.
Previous: Junio C HamanoNext: Junio C Hamano
Message 6 of 8 in “A test for commit --amend allowing changing of a very empty commit message”
  1. A test for commit --amend allowing changing of a very empty commit messageAlex Riesen, Feb 21, 2008
  2. Junio C HamanoFeb 21, 2008
  3. Alex RiesenFeb 21, 2008
  4. Fix amending of a commit with an empty messageAlex Riesen, Feb 21, 2008
  5. Junio C HamanoFeb 21, 2008
  6. Alex RiesenFeb 21, 2008
  7. Junio C HamanoFeb 21, 2008
  8. Johannes SchindelinFeb 21, 2008

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.