Skip to content
Browse files

git-todays-commits filters on authored-date, not committed-date

  • Loading branch information...
1 parent 11df5e5 commit 768f7d7695d470de27af76adccb78082bb26c65d @mjdominus committed Jun 11, 2012
Showing with 14 additions and 1 deletion.
  1. +14 −1 git-todays-commits
View
15 git-todays-commits
@@ -1,12 +1,25 @@
#!/usr/bin/perl
+use Time::Local;
+my $when = do {
+ my @date = localtime;
+ @date = localtime(time() - 86400) if $date[2] < 9;
+ @date[2,1,0] = (9, 0, 0);
+ timelocal(@date);
+};
+
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";
+ my @commitids =
+ map { $_->[1] }
+ grep { $_->[0] >= $when }
+ map { [ split ] } qx{git log --reverse --since 9AM --all --format="%at %H" --author=mjd};
+
+ $logs .= qx{git log -n1 --stat $_} . "\n" for @commitids;
}
if ($logs =~ /\S/) {

0 comments on commit 768f7d7

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