From 1e876e207a62035eec5805dae35bbae6383d338f Mon Sep 17 00:00:00 2001 From: "Bradley M. Kuhn" Date: Sat, 26 Jun 2010 14:46:52 -0400 Subject: [PATCH] Added skip author regex. --- filter-git-log.plx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/filter-git-log.plx b/filter-git-log.plx index 33e550f..630b777 100755 --- a/filter-git-log.plx +++ b/filter-git-log.plx @@ -25,11 +25,11 @@ use strict; use warnings; -if (@ARGV != 2) { - print STDERR "usage: $0 \n"; +if (@ARGV < 2 or @ARGV > 3) { + print STDERR "usage: $0 []\n"; exit 1; } -my($GIT_CMD, $DATE_RANGE_CODE_FILE) = @ARGV; +my($GIT_CMD, $DATE_RANGE_CODE_FILE, $SKIP_AUTHOR_REGEX) = @ARGV; # DATE_RANGE_CODE_FILE must define a one-arg function called DateIsInRange() require "$DATE_RANGE_CODE_FILE"; @@ -46,7 +46,10 @@ while (my $line = ) { $skipThisOne = 0; $currentCommit = ""; } elsif ($line =~ /^\s*Date\s*:\s*(.+)$/i) { - $skipThisOne = not DateIsInRange($1); + $skipThisOne = not DateIsInRange($1) if not $skipThisOne; + } elsif ($line =~ /^\s*Author\s*:\s*(.+)$/i) { + my $author = $1; + $skipThisOne = 1 if $author =~ /$SKIP_AUTHOR_REGEX/; } $currentCommit .= $line; }