[Bps-public-commit] Test-Chimps-Client branch, master, updated. b1774a62425c7a7dc345abff4941ed847f3b159c

Kevin Falcone falcone at bestpractical.com
Thu Oct 1 17:51:31 EDT 2009


The branch, master has been updated
       via  b1774a62425c7a7dc345abff4941ed847f3b159c (commit)
      from  5645d8a82d1f9a78e9fda3890b260f66544a7134 (commit)

Summary of changes:
 lib/Test/Chimps/Smoker/Git.pm |   26 ++++++++++----------------
 1 files changed, 10 insertions(+), 16 deletions(-)

- Log -----------------------------------------------------------------
commit b1774a62425c7a7dc345abff4941ed847f3b159c
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Thu Oct 1 17:50:53 2009 -0400

    Somewhat better rev parsing to find the next commit
    
    Probably still vulnerable to merge commits
    We can do date parsing, but only Committer date not Author date which
    the old code was doing

diff --git a/lib/Test/Chimps/Smoker/Git.pm b/lib/Test/Chimps/Smoker/Git.pm
index 36b0edc..c70c6ca 100644
--- a/lib/Test/Chimps/Smoker/Git.pm
+++ b/lib/Test/Chimps/Smoker/Git.pm
@@ -15,22 +15,16 @@ sub _init {
 sub revision_after {
     my $self = shift;
     my $revision = shift;
-    
-# in case of the following topology:
-#    H
-# B1   B2
-#    R
-# `git log B1..H` always has B2 when `git log B2..H` always has B1
-# we end up in a loop. let's use date of the current revision to
-# to cut of anything older. In this case some commits in branches
-# wouldn't be tested
-    my $cmd = 'git log -n1 '. $revision;
-    my ($date) = (`$cmd` =~ m/^date:\s*(.*)$/im);
-
-    $cmd = "git log --reverse --since='$date' $revision..origin/". $self->branch;
-    my ($next)  = (`$cmd` =~ m/^commit\s+([a-f0-9]+)$/im);
-
-    return $next;
+
+    # stolen shamelessly from post-receive-email
+    # this probably still loops and needs some date support
+    # or a stash or shas to test
+    my $branch = $self->branch;
+    my $cmd = "git rev-parse --not --branches | grep -v \$(git rev-parse $branch) | git rev-list --stdin $revision..origin/$branch | tail -n 1";
+    my $next = `$cmd`;
+    chomp($next) if $next;
+
+    die "next $next revision $revision";
 }
 
 sub committer {

-----------------------------------------------------------------------



More information about the Bps-public-commit mailing list