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

Re: [PATCH] commit: inform pre-commit if --amend is used

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 25, 2014, 04:58 UTC
Message-ID
<xmqqtx1nub9e.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20141125034424.GA19161@peff.net>
Jeff King <peff@peff.net> writes:
Show 12 quoted lines
>   1. It is a bit more obvious when debugging or dumping arguments (e.g.,
>      via GIT_TRACE), especially if new options are added after the
>      first.
>
>   2. It makes it easier for a script to work on old and new versions of
>      git. It sees either "amend" or "noamend" for the two obvious cases,
>      and if it sees no argument, then it knows that it does not know
>      either way (it is running on an old version of git).
>
>      Technically one can tell the difference in shell between an empty
>      string and a missing argument, but it is sufficiently subtle that I
>      think "noamend" is a better route.

If we ever add more info, would we want to keep piling on new arguments, though? Wouldn't it a viable option to use "amend" vs not giving anything (not even an empty string), so that normal case there won't be no parameter?

Previous: Jeff KingNext: Jeff King
Message 4 of 9 in “commit: inform pre-commit if --amend is used”
  1. commit: inform pre-commit if --amend is usedØystein Walle, Nov 24, 2014
  2. Eric SunshineNov 24, 2014
  3. Jeff KingNov 25, 2014
  4. Junio C HamanoNov 25, 2014
  5. Jeff KingNov 25, 2014
  6. Mark LevedahlNov 27, 2014
  7. Jeff KingNov 28, 2014
  8. Mark LevedahlNov 28, 2014
  9. Junio C HamanoDec 1, 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.