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

Re: [PATCH] Documentation: --amend cannot be combined with -c/-C/-F.

From
Junio C Hamano <junkio@cox.net>
Date
Jan 25, 2007, 22:21 UTC
Message-ID
<7vodom9284.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<slrnerh8la.7v0.mdw@metalzone.distorted.org.uk>
Mark Wooding <mdw@distorted.org.uk> writes:
Show 5 quoted lines
> Currently -c (copy some other commit message, and then edit it) is
> considered to be a `force message to be...' kind of option, like the
> others I've listed above.
>
> So, for some reason, is --amend.  This last is really annoying.

I think the mindset is a bit different. The -C/-c options are about the latter half of cherry-picking. The user asks "reuse the message from an existing commit so that I do not have to type", or "I could reuse the original log message almost as-is, but I am using the change in a slightly different context from the original commit (and that is why cherry-pick did not finish by itself and you need to run git-commit after fixing up), so I would need to talk a bit about what I did in the fix-up in the log message". Both are useful.

Amend is conflated -- you are amending what you did, either perhaps you found a small typo in the code in which case the difference between what is being amended and what will be committed may only be the tree and you would want to re-use an existing message as-is, or you found a small typo in the log message in which case there won't be any difference in the trees but you do want to spellfix the log message, or you may be fixing both.

We happen default to the edit behaviour for no particular reason, other than "because :q or C-x # are cheap".

Unfortunatly there is no good default for this case -- fixing tree and fixing message are both almost equally often used in the real world, so changing --amend not to let you edit by default and adding --edit option would inconvenience other use case.

Adding --no-edit option is not very nice either. It's almost as cumbersome to type as "EDITOR=:".

What you want might be an --amend-tree option; it would be to the --amend option what the -C (--reuse-message) option is to the -c (--reedit-message).

Previous: Mark WoodingNext: Matthias Lederhofer
Message 3 of 4 in “Documentation: --amend cannot be combined with -c/-C/-F.”
  1. Documentation: --amend cannot be combined with -c/-C/-F.Peter Eriksen, Jan 24, 2007
  2. Mark WoodingJan 25, 2007
  3. Junio C HamanoJan 25, 2007
  4. Matthias LederhoferJan 25, 2007

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.