Re: Thoughts on adding another hook to git

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



David Kowis <dkowis@xxxxxxxxx> 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.


-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]