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

Re: [PATCH] git-commit: add a prepare-commit-msg hook

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 21, 2008, 22:44 UTC
Message-ID
<7vve5mx0hd.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<4794972F.9000007@gnu.org>
Paolo Bonzini <bonzini@gnu.org> writes:
Show 7 quoted lines
>> Actually, reading your patch again I think it also triggers for
>> "-c", as well as for "[-C|-F|-m] ... -e".
>
> Not for "-c", that's the point of the "edit_message" check.  You're
> right about "-e" though.
>
> Points taken, and patch will be resubmitted after 1.5.4.

Thanks. I think the approach is sane, and it naturally falls into the second category of "why we might want to a hook for" list I sent earlier.

I do not think adding "-X makes that hook ignored" for description of every option is warranted, though. Users should not have to be reminded that there is a hook he may never use and it does not trigger if he specifies his own message using -X or -Y or -Z option.

The usage of the hook is optional, and the primary description of what it does and why a user might want to use it should be in its own description (perhaps in hooks.txt and a section that lists hooks in git-commit manpage). As long as that description makes it clear that the hook is a way to specify a dynamic template in a situation that requries a fresh message, the users who are interested in using it would perfectly well understand that options that make git-commit not to take a fresh message would not invoke the hook.

Previous: Paolo Bonzini
Message 23 of 23 in “git-commit: add a prepare-commit-msg hook”
  1. git-commit: add a prepare-commit-msg hookPaolo Bonzini, Jan 18, 2008
  2. Johannes SchindelinJan 18, 2008
  3. Paolo BonziniJan 18, 2008
  4. Johannes SchindelinJan 18, 2008
  5. Paolo BonziniJan 18, 2008
  6. Johannes SchindelinJan 18, 2008
  7. Paolo BonziniJan 18, 2008
  8. Benoit SigoureJan 18, 2008
  9. Alex RiesenJan 18, 2008
  10. Paolo BonziniJan 18, 2008
  11. Alex RiesenJan 18, 2008
  12. Junio C HamanoJan 18, 2008
  13. Paolo BonziniJan 19, 2008
  14. Johannes SchindelinJan 19, 2008
  15. Benoit SigoureJan 19, 2008
  16. Paolo BonziniJan 19, 2008
  17. Junio C HamanoJan 20, 2008
  18. Paolo BonziniJan 21, 2008
  19. Johannes SchindelinJan 21, 2008
  20. Paolo BonziniJan 21, 2008
  21. Johannes SchindelinJan 21, 2008
  22. Paolo BonziniJan 21, 2008
  23. Junio C HamanoJan 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.