Skip to content

Commit

Permalink
git-todays-commits filters on authored-date, not committed-date
Browse files Browse the repository at this point in the history
  • Loading branch information
mjdominus committed Jun 11, 2012
1 parent 11df5e5 commit 768f7d7
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion git-todays-commits
@@ -1,12 +1,25 @@
#!/usr/bin/perl #!/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 $logs = "";
my $GITDIR = shift() || "$ENV{HOME}/src/pobox"; my $GITDIR = shift() || "$ENV{HOME}/src/pobox";
for my $repo (qw(pm moonpig)) { for my $repo (qw(pm moonpig)) {
my $dir = "$GITDIR/$repo"; my $dir = "$GITDIR/$repo";
chdir $dir or die "chdir $dir: $!"; chdir $dir or die "chdir $dir: $!";
system("git fetch origin"); 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/) { if ($logs =~ /\S/) {
Expand Down

0 comments on commit 768f7d7

Please sign in to comment.