X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FGit.pm;h=2ae5eff9c01614a13f0781561c9aed64d1a52838;hb=081918279573b209c27a91e443c37df597bcd43f;hp=c6c1c80205ae8556b1ee976417c37fa2e8baa7ed;hpb=d679cbb1b5ad95d2689bc3b8f78da2b380fc7860;p=public-inbox.git diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm index c6c1c802..2ae5eff9 100644 --- a/lib/PublicInbox/Git.pm +++ b/lib/PublicInbox/Git.pm @@ -362,10 +362,8 @@ sub popen { # same args as popen above sub qx { - my $self = shift; - my $fh = $self->popen(@_); + my $fh = popen(@_); if (wantarray) { - local $/ = "\n"; my @ret = <$fh>; close $fh; # caller should check $? @ret; @@ -377,6 +375,13 @@ sub qx { } } +sub date_parse { + my $self = shift; + map { + substr($_, length('--max-age='), -1) + } $self->qx('rev-parse', map { "--since=$_" } @_); +} + # check_async and cat_async may trigger the other, so ensure they're # both completely done by using this: sub async_wait_all ($) { @@ -422,7 +427,7 @@ sub local_nick ($) { my $ret = '???'; # don't show full FS path, basename should be OK: if ($self->{git_dir} =~ m!/([^/]+)(?:/\.git)?\z!) { - $ret = "/path/to/$1"; + $ret = "$1.git"; } wantarray ? ($ret) : $ret; } @@ -462,20 +467,6 @@ sub cat_async ($$$;$) { push(@$inflight, $oid, $cb, $arg); } -sub async_prefetch { - my ($self, $oid, $cb, $arg) = @_; - if (my $inflight = $self->{inflight}) { - # we could use MAX_INFLIGHT here w/o the halving, - # but lets not allow one client to monopolize a git process - if (scalar(@$inflight) < int(MAX_INFLIGHT/2)) { - print { $self->{out} } $oid, "\n" or - $self->fail("write error: $!"); - return push(@$inflight, $oid, $cb, $arg); - } - } - undef; -} - sub extract_cmt_time { my ($bref, undef, undef, undef, $modified) = @_;