author | Shawn O. Pearce <spearce@spearce.org> | |
Sun, 20 Jan 2008 19:11:52 +0000 (14:11 -0500) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Mon, 21 Jan 2008 03:45:37 +0000 (22:45 -0500) | ||
commit | fb0ca475c6ab02eeeb8ca7f2c0558d64301a8800 | |
tree | 9b9c333baf17b20ea125a4099a29c02878479631 | tree | snapshot |
parent | a02855711310b553c610fe7ef634f4ceb25fe9f6 | commit | diff |
git-gui: Honor the standard commit-msg hook
Under core Git the git-commit tool will invoke the commit-msg hook
if it exists and is executable to the user running git-commit. As
a hook it has some limited value as it cannot alter the commit, but
it can modify the message the user is attempting to commit. It is
also able to examine the message to ensure it conforms to some local
standards/conventions.
Since the hook takes the name of a temporary file holding the message
as its only parameter we need to move the code that creates the temp
file up earlier in our commit code path, and then pass through that
file name to the latest stage (where we call git-commit-tree). We let
the hook alter the file as it sees fit and we don't bother to look at
its content again until the commit succeeded and we need the subject
for the reflog update.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Under core Git the git-commit tool will invoke the commit-msg hook
if it exists and is executable to the user running git-commit. As
a hook it has some limited value as it cannot alter the commit, but
it can modify the message the user is attempting to commit. It is
also able to examine the message to ensure it conforms to some local
standards/conventions.
Since the hook takes the name of a temporary file holding the message
as its only parameter we need to move the code that creates the temp
file up earlier in our commit code path, and then pass through that
file name to the latest stage (where we call git-commit-tree). We let
the hook alter the file as it sees fit and we don't bother to look at
its content again until the commit succeeded and we need the subject
for the reflog update.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
lib/commit.tcl | diff | blob | history |