From 7acc424f94cd0edf7e6a6bbcd531d1f0a8f6345c Mon Sep 17 00:00:00 2001 From: "Bradley M. Kuhn" Date: Sat, 26 Jun 2010 13:45:07 -0400 Subject: [PATCH] Fixed regular expression, open arg, and git options; basically working script now. --- filter-git-log.plx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/filter-git-log.plx b/filter-git-log.plx index a2c2b7d..8bcc7b1 100755 --- a/filter-git-log.plx +++ b/filter-git-log.plx @@ -30,20 +30,21 @@ if (@ARGV != 1) { } my($GIT_CMD) = @ARGV; +$GIT_CMD .= " --no-color"; $GIT_CMD .= " --date=rfc" unless $GIT_CMD =~ /--date/; -open(GIT_OUTPUT, "|-", $GIT_CMD) or die "unable to run \"$GIT_CMD\": $!"; +open(GIT_OUTPUT, "-|", $GIT_CMD) or die "unable to run \"$GIT_CMD\": $!"; my $currentCommit = ""; my $skipThisOne = 1; while (my $line = ) { - if ($line =~ /^\s*commit\s+/) { + if ($line =~ /^\s*commit\s+/i) { print $currentCommit unless $skipThisOne; $skipThisOne = 0; $currentCommit = ""; - } elsif ($line = /^\s*Date:\s*(\S+)\,/) { #Warning: assumes --date=rfc + } elsif ($line =~ /^\s*Date\s*:\s*(\S+)\s*,/i) { #Warning: assumes --date=rfc my $day = $1; - $skipThisOne = ($day !~ /(Sat|Sun)/); + $skipThisOne = ($day !~ /(Sat|Sun)/i); } $currentCommit .= $line; }