Skip to content

Instantly share code, notes, and snippets.

@mikerhodes
Forked from tomblench/gist:8436408
Created January 15, 2014 13:44
Show Gist options
  • Save mikerhodes/8436475 to your computer and use it in GitHub Desktop.
Save mikerhodes/8436475 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