author | Junio C Hamano <gitster@pobox.com> | |
Sun, 11 Mar 2012 10:12:10 +0000 (03:12 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sun, 11 Mar 2012 21:07:22 +0000 (14:07 -0700) | ||
commit | 7dfe8ad6006c105989e4e8cfb196aa4ecda3c21d | |
tree | 9a1d17b41eaa4c7a562d2429af0ffd493659b444 | tree | snapshot |
parent | 04861982e553289c923b2f9ef829ef33206c9bc4 | commit | diff |
commit: pass author/committer info to hooks
When lying the author name via GIT_AUTHOR_NAME environment variable
to "git commit", the hooks run by the command saw it and could act
on the name that will be recorded in the final commit. When the user
uses the "--author" option from the command line, the command should
give the same information to the hook, and back when "git command"
was a scripted Porcelain, it did set the environment variable and
hooks can learn the author name from it.
However, when the command was reimplemented in C, the rewritten code
was not very faithful to the original, and hooks stopped getting the
authorship information given with "--author". Fix this by exporting
the necessary environment variables.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
When lying the author name via GIT_AUTHOR_NAME environment variable
to "git commit", the hooks run by the command saw it and could act
on the name that will be recorded in the final commit. When the user
uses the "--author" option from the command line, the command should
give the same information to the hook, and back when "git command"
was a scripted Porcelain, it did set the environment variable and
hooks can learn the author name from it.
However, when the command was reimplemented in C, the rewritten code
was not very faithful to the original, and hooks stopped getting the
authorship information given with "--author". Fix this by exporting
the necessary environment variables.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/commit.c | diff | blob | history | |
t/t7503-pre-commit-hook.sh | diff | blob | history |