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

Re: Thoughts on adding another hook to git

From
Junio C Hamano <junkio@cox.net>
Date
Jun 13, 2006, 18:41 UTC
Message-ID
<7virn4gapp.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<448DB201.5090208@shlrm.org>
David Kowis <dkowis@shlrm.org> writes:
> I'd like to be able to modify the commit message before it ends up in
> the $EDITOR. This is a fairly trivial thing to implement:
> Call ${GIT_DIR}/hooks/pre-editor on COMMIT_MESSAGE before opening it in
> $EDITOR.
Three random thoughts.
 - pre-editor is too generic a name because before making a
   commit is not the only place we give you $EDITOR (both am and
   tag do EDITOR thing IIRC).  So the hook name must be more
   specific to the commit codepath (otherwise your pre-editor
   hook needs to be able to tell which codepath called it).
 - git-commit gives you EDITOR when you are making a merge, and
   you would probably want to keep the default merge commit
   message without the prefixed directory thing.  You probably
   do not want to do this while doing --amend either.
 - it might make sense to have a "commit template" that is used
   when making a non-merge commit afresh (i.e. without -F, -m,
   -c or -C to specify messages), instead of a hook script.
Previous: Nikolai Weibull
Message 9 of 9 in “Thoughts on adding another hook to git”
  1. David KowisJun 12, 2006
  2. Yakov LernerJun 12, 2006
  3. David KowisJun 12, 2006
  4. Yakov LernerJun 12, 2006
  5. David KowisJun 12, 2006
  6. Nikolai WeibullJun 13, 2006
  7. David KowisJun 13, 2006
  8. Nikolai WeibullJun 13, 2006
  9. Junio C HamanoJun 13, 2006

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.