Skip to content

Instantly share code, notes, and snippets.

@tomblench
Created January 15, 2014 13:42
Show Gist options
  • Save tomblench/8436408 to your computer and use it in GitHub Desktop.
Save tomblench/8436408 to your computer and use it in GitHub Desktop.
Put this in .git/hooks/commit-msg for each git project
#!/usr/bin/env perl -w
my $file = $ARGV[0];
my $bad = 0;
open(my $FH, "<", $file);
while(<$FH>) {
if ((length) > 50) {
print("line $. too long\n");
$bad = 1;
}
}
$bad && exit 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment