From 0623f3a8f5d6fbc5e9b933cb034184084e8ac666 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Mon, 15 Jan 2018 09:17:02 +0100 Subject: 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 Tested-by: Michael Meeks --- .git-hooks/pre-commit | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to '.git-hooks') 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 /) + { + 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: -- cgit