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

Re: [PATCH 0/2] pre-commit hook updates

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 26, 2014, 18:35 UTC
Message-ID
<xmqqfvd5res5.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20141126045246.GD15252@peff.net>
Jeff King <peff@peff.net> writes:
Show 10 quoted lines
> On Tue, Nov 25, 2014 at 11:51:27PM +0100, Øystein Walle wrote:
>
>> I agree with Junio Hamano that it's better to provide no argument at all
>> rather than an empty one. I also agree with Jeff King that "noamend" is
>> better than an empty argument. I went with the second one since Jeff
>> seemed to get the last word :)
>
> I am not sure the last word counts for much. :) We'll see if Junio
> responds (there, or to your patch). I do not feel _too_ strongly either
> way, and I don't have much else to say besides what was said.

I _think_ "give only info that is necessary" is cleaner as an interface in theory, but have two niggles myself:

 1. the hooks must do the "argument parsing" loop (you already
    mentioned this);
 2. the hooks cannot tell if the lack of "amending" argument is
    because the version of Git predates that "amending" hint
    support, or because the user action is a straight "commit" not
    an "commit --amend".
In any case, I do not have strong preference myself.
Previous: Jeff KingNext: Jeff King
Message 12 of 13 in “pre-commit hook updates”
  1. 0/2 pre-commit hook updatesØystein Walle, Nov 25, 2014
  2. 1/2 t7503: use write_script to generate hook scriptsØystein Walle, Nov 25, 2014
  3. Eric SunshineNov 26, 2014
  4. Jeff KingNov 26, 2014
  5. Junio C HamanoNov 26, 2014
  6. Jeff KingNov 26, 2014
  7. Junio C HamanoNov 26, 2014
  8. 2/2 commit: inform pre-commit that --amend was usedØystein Walle, Nov 25, 2014
  9. Eric SunshineNov 26, 2014
  10. Eric SunshineNov 26, 2014
  11. Jeff KingNov 26, 2014
  12. Junio C HamanoNov 26, 2014
  13. Jeff KingNov 26, 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.