From: Junio C Hamano Date: Tue, 13 Jun 2006 18:41:06 GMT Subject: Re: Thoughts on adding another hook to git Message-ID: <7virn4gapp.fsf@assigned-by-dhcp.cox.net> In-Reply-To: <448DB201.5090208@shlrm.org> David Kowis 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.