1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-14 13:13:01 +01:00
git/templates
Paolo Bonzini 8089c85bcb git-commit: add a prepare-commit-msg hook
The prepare-commit-msg hook is run whenever a "fresh" commit message
is prepared, just before it is shown in the editor (if it is).
Its purpose is to modify the commit message in-place.

It takes one to three parameters.  The first is the name of the file that
the commit log message.  The second is the source of the commit message,
and can be: "message" (if a -m or -F option was given); "template" (if a
-t option was given or the configuration option commit.template is set);
"merge" (if the commit is a merge or a .git/MERGE_MSG file exists);
"squash" (if a .git/SQUASH_MSG file exists); or "commit", followed by
a commit SHA1 as the third parameter (if a -c, -C or --amend option
was given).

If its exit status is non-zero, git-commit will abort.  The hook is
not suppressed by the --no-verify option, so it should not be used
as a replacement for the pre-commit hook.

The sample prepare-commit-msg comments out the `Conflicts:` part of
a merge's commit message; other examples are commented out, including
adding a Signed-off-by line at the bottom of the commit messsage,
that the user can then edit or discard altogether.

Signed-off-by: Paolo Bonzini <bonzini@gnu.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-06 02:26:55 -08:00
..
.gitignore
branches--
hooks--applypatch-msg
hooks--commit-msg git-commit: add a prepare-commit-msg hook 2008-02-06 02:26:55 -08:00
hooks--post-commit
hooks--post-receive
hooks--post-update
hooks--pre-applypatch
hooks--pre-commit Make default pre-commit hook less noisy 2008-01-14 13:52:27 -08:00
hooks--pre-rebase
hooks--prepare-commit-msg git-commit: add a prepare-commit-msg hook 2008-02-06 02:26:55 -08:00
hooks--update Officially deprecate repo-config. 2008-01-17 22:52:40 -08:00
info--exclude
Makefile install-sh from automake does not like -m without delimiting space 2007-12-03 22:11:53 -08:00
this--description