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

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

From
Mark Levedahl <mlevedahl@gmail.com>
Date
Nov 28, 2014, 15:49 UTC
Message-ID
<5478996F.5050207@gmail.com>
In-Reply-To
<20141128051805.GA19258@peff.net>
On 11/28/2014 12:18 AM, Jeff King wrote:
Show 23 quoted lines
> On Thu, Nov 27, 2014 at 09:40:08AM -0500, Mark Levedahl wrote:
>
>>> Then when you add new arguments, the hook has to search through the
>>> parameters looking for one that matches, rather than just checking "$1"
>>> for "amend" (and "$2" for the new option, and so on). As long as the set
>>> of options remains relatively small, I think that is preferable.
>>>
>>> We could also just pass them through the environment, which gives nice
>>> named parameters.
>>>
>> See http://comments.gmane.org/gmane.comp.version-control.git/148479 for an
>> earlier conversation on this exact topic. Also, see
>> http://permalink.gmane.org/gmane.comp.version-control.git/148480 for a
>> similar change in git-gui.
> Thanks for the links; I had no recollection of that thread.
> Unsurprisingly, I like the "HEAD"/"HEAD~1" suggestion. That "peff" guy
> seems really clever (and handsome, too, I'll bet).
>
> I'd still be OK with any of the suggestions given in this thread,
> though.
>
> -Peff
> ars

Apparently our combined handsome-foo was insufficient to get this accepted way back when, hopefully the current submitter has more :^)

In any event, I've carried the patches using HEAD/HEAD~1 in my tree for the last 4+ years, have a widely used pre-commit script that depends upon those. So, I personally would be very happy to see this finally show up in Junio's tree, would prefer HEAD/HEAD~1 but can adapt to whatever.

Mark
Previous: Jeff KingNext: Junio C Hamano
Message 8 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.