Skip to content

Instantly share code, notes, and snippets.

@jonny64
Created November 3, 2011 13:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonny64/23b807f29c37c5699670 to your computer and use it in GitHub Desktop.
Save jonny64/23b807f29c37c5699670 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
my ($branch, $before_sha, $after_sha) = @ARGV;
warn "updating ref $branch";
if ($branch ne 'refs/heads/master') {
exit 0;
}
my $testing_merges=`git log --pretty=%s $before_sha..$after_sha | grep "testing" | wc -l`;
chop $testing_merges;
if (0 + $testing_merges > 0) {
warn "error: possible merge of testing branch into master, do not use 'testing' in commit message";
warn " $testing_merges";
exit 1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment