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

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

From
Paolo Bonzini <bonzini@gnu.org>
Date
Jan 21, 2008, 12:59 UTC
Message-ID
<4794972F.9000007@gnu.org>
In-Reply-To
<alpine.LSU.1.00.0801211231480.5731@racer.site>
Show 8 quoted lines
>> Sure it won't break anything, but it won't work either!  The existing 
>> message hook runs after the editing session -- I want the hook to 
>> introduce text that is merely a suggestion that the user can delete, or 
>> a template that the user needs to customize further.
> 
> OMG you're right.  But why didn't you say so in the commit message?  
> Something like "This hook complements the commit-msg hook, in that it runs 
> _before_ the editor is launched".
I can't believe this. ;-)  At least I'm laughing for something nice now!
You're right, I should have said instead of this:
> The prepare-commit-msg hook is run whenever a "fresh" commit message 
> (i.e. not one taken from another commit with -c) is shown in the editor. 
... just before a "fresh" commit message is shown in the editor.
          ^^^^^^
Show 9 quoted lines
>>> Also, the change would be non-intrusive, easy-to-review
>> Please.  That's ludicrous.
>>
>> My patch is 3 lines of inserted code and 0 modified lines, checking one 
>> variable that is set once in builtin-commit.c (edit_message).
> 
> Actually, after reading the commit message I was in 
> "this-is-not-necessary" mode, and therefore the diffstat looked too large 
> for me.
Yes, but still the diffstat was all .txt files... ;-)
> 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.
Paolo
Previous: Johannes SchindelinNext: Junio C Hamano
Message 22 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.