Skip to content
Browse files

Add git pre-commit to generate a README.pod

  • Loading branch information...
1 parent bfc515e commit a22b28a45b8a2afa758c1c414677864c38675c08 @hinrik committed Aug 17, 2010
Showing with 16 additions and 0 deletions.
  1. +1 −0 MANIFEST.SKIP
  2. +15 −0 utils/developer/git-pre-commit
View
1 MANIFEST.SKIP
@@ -4,3 +4,4 @@
^blib/
^pm_to_blib$
^cover_db/
+^utils/developer/
View
15 utils/developer/git-pre-commit
@@ -0,0 +1,15 @@
+#!/usr/bin/env perl
+
+# ln -s ../../utils/developer/git-pre-commit .git/hooks/pre-commit
+
+use strict;
+use warnings FATAL => 'all';
+
+my $file = 'bin/grok';
+my $old = qx"git rev-parse HEAD:$file 2>/dev/null";
+my $new = qx"git rev-parse :$file 2>/dev/null";
+
+if (($? >> 8) != 0 || $old ne $new || !-e 'README.pod') {
+ system qq[ack -h '^=encoding' -A 9001 $file > README.pod];
+ system "git add README.pod";
+}

0 comments on commit a22b28a

Please sign in to comment.
Something went wrong with that request. Please try again.