Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

  • Loading branch information...
commit 768f7d7695d470de27af76adccb78082bb26c65d 1 parent 11df5e5
Mark Jason Dominus (陶敏修) authored

Showing 1 changed file with 14 additions and 1 deletion. Show diff stats Hide diff stats

  1. +14 1 git-todays-commits
15 git-todays-commits
... ... @@ -1,12 +1,25 @@
1 1 #!/usr/bin/perl
2 2
  3 +use Time::Local;
  4 +my $when = do {
  5 + my @date = localtime;
  6 + @date = localtime(time() - 86400) if $date[2] < 9;
  7 + @date[2,1,0] = (9, 0, 0);
  8 + timelocal(@date);
  9 +};
  10 +
3 11 my $logs = "";
4 12 my $GITDIR = shift() || "$ENV{HOME}/src/pobox";
5 13 for my $repo (qw(pm moonpig)) {
6 14 my $dir = "$GITDIR/$repo";
7 15 chdir $dir or die "chdir $dir: $!";
8 16 system("git fetch origin");
9   - $logs .= qx{git log --reverse --since 9AM --all --stat --author=mjd} . "\n";
  17 + my @commitids =
  18 + map { $_->[1] }
  19 + grep { $_->[0] >= $when }
  20 + map { [ split ] } qx{git log --reverse --since 9AM --all --format="%at %H" --author=mjd};
  21 +
  22 + $logs .= qx{git log -n1 --stat $_} . "\n" for @commitids;
10 23 }
11 24
12 25 if ($logs =~ /\S/) {

0 comments on commit 768f7d7

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