+ if (defined $since) {
+ my @cmd = (qw(git rev-list), "--since=$since", $tip);
+ my $tmp;
+
+ # get the commit last in the list, unfortunately --reverse
+ # is not usable with --since
+ open my $rl, '-|', @cmd or die "failed to open rev-list: $!\n";
+ foreach my $cmt (<$rl>) {
+ chomp $cmt;
+
+ # do not re-import even if --since is specified
+ if (defined $last && ($last eq $cmt)) {
+ $tmp = undef;
+ last
+ }
+ $tmp = $cmt;
+ }
+ close $rl; # we may break the pipe here
+ $last = $tmp if defined $tmp;
+ }