Permalink
Browse files

draft of git-todays-commits

  • Loading branch information...
1 parent 058cf92 commit 11df5e5bf432c096767cf8f9f789ce00b297e9c9 @mjdominus committed Jun 11, 2012
Showing with 21 additions and 0 deletions.
  1. +21 −0 git-todays-commits
View
21 git-todays-commits
@@ -0,0 +1,21 @@
+#!/usr/bin/perl
+
+my $logs = "";
+my $GITDIR = shift() || "$ENV{HOME}/src/pobox";
+for my $repo (qw(pm moonpig)) {
+ my $dir = "$GITDIR/$repo";
+ chdir $dir or die "chdir $dir: $!";
+ system("git fetch origin");
+ $logs .= qx{git log --reverse --since 9AM --all --stat --author=mjd} . "\n";
+}
+
+if ($logs =~ /\S/) {
+ print "Today's commits:\n\n$logs\n";
+} else {
+ print "I didn't find any commits today. I wonder why not?
+Holiday? Wrong repository? Forgot to push? Out sick?
+Or maybe the program couldn't fetch the new commits.
+Better find out!
+";
+}
+

0 comments on commit 11df5e5

Please sign in to comment.