diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2018-01-15 09:17:02 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2018-01-15 11:08:26 +0100 |
commit | 0623f3a8f5d6fbc5e9b933cb034184084e8ac666 (patch) | |
tree | 238f763e26b67287f59be8577a06287ea153de75 /.git-hooks | |
parent | 34d8710fff4859d455b51a7e0d90fe3a35bf2e6b (diff) |
git pre-commit hook: catch copy&pasted author identity
git log --author="Your"
confirms that this happens in practice.
Change-Id: I48633bc9154ebc66fc022938831057bdc3ff76b3
Reviewed-on: https://gerrit.libreoffice.org/47892
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to '.git-hooks')
-rwxr-xr-x | .git-hooks/pre-commit | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/.git-hooks/pre-commit b/.git-hooks/pre-commit index e859919fa566..8c4e86345aa1 100755 --- a/.git-hooks/pre-commit +++ b/.git-hooks/pre-commit @@ -109,6 +109,17 @@ sub check_whitespaces($) } } +sub check_author() +{ + my $author = `git var GIT_AUTHOR_IDENT`; + chomp $author; + if ($author =~ /^Your Name <you\@example.com>/) + { + print("ERROR: You have a suspicious author identity: '$author'\n"); + exit(1); + } +} + sub check_style($) { if (! -e "solenv/clang-format/ClangFormat.pm") @@ -266,6 +277,9 @@ check_whitespaces( $against); # fix style in code check_style($against); +# catch missing author info +check_author(); + # all OK exit( 0 ); # vi:set shiftwidth=4 expandtab: |