diff options
author | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2016-01-12 20:07:21 +0100 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2016-01-13 09:54:18 +0000 |
commit | c2c4f5504a3a0db0154613831a924127fb659abe (patch) | |
tree | a6cf7b535ef2675995095efa8ef87ad8cdfb7aa7 | |
parent | 002ed911052ecc528bd584c9a94b75090d247e78 (diff) |
use git-cat-file instead of git-log to get commit message
only this way we can ensure that we get it really verbatim.
Change-Id: I0d11a1b87fcacf7cc3b9473b05562f5af2b677d2
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
-rwxr-xr-x | git-hooks/sanitize-commit | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/git-hooks/sanitize-commit b/git-hooks/sanitize-commit index 3fbe293..1be1c47 100755 --- a/git-hooks/sanitize-commit +++ b/git-hooks/sanitize-commit @@ -267,19 +267,19 @@ sub check_apple_terminology() } my $msgline = 0; -open MSG, "git log -1 --pretty=raw ".$sha1." |" or die "cannot run git: $!"; +open MSG, "git cat-file -p ".$sha1." |" or die "cannot run git: $!"; while (<MSG>) { - chomp; - if (!s/^ //) { - if (/^parent /) { - $parents++ ; - } elsif (/^author ([^<]*?) *<([^>]+)/) { - check_email($1, $2, $parents + 1, "author"); - } elsif (/^commiter ([^<]*?) *<([^>]+)/) { - check_email($1, $2, $parents + 3, "committer"); - } - next + last if ($_ eq "\n"); + if (/^parent /) { + $parents++ ; + } elsif (/^author ([^<]*?) *<([^>]+)/) { + check_email($1, $2, $parents + 1, "author"); + } elsif (/^commiter ([^<]*?) *<([^>]+)/) { + check_email($1, $2, $parents + 3, "committer"); } +} +while (<MSG>) { + chomp; $lineno++; $msgline++; if ($msgline == 1) { |