From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: * X-Spam-Status: No, score=1.3 required=5.0 tests=RDNS_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 Received: (qmail 22378 invoked from network); 11 Apr 2022 03:20:39 -0000 Received: from unknown (HELO 9front.inri.net) (168.235.81.73) by inbox.vuxu.org with ESMTPUTF8; 11 Apr 2022 03:20:39 -0000 Received: from mimir.eigenstate.org ([206.124.132.107]) by 9front; Sun Apr 10 23:19:26 -0400 2022 Received: from abbatoir.myfiosgateway.com (pool-74-108-56-225.nycmny.fios.verizon.net [74.108.56.225]) by mimir.eigenstate.org (OpenSMTPD) with ESMTPSA id 9b6039ac (TLSv1.2:ECDHE-RSA-AES256-SHA:256:NO) for <9front@9front.org>; Sun, 10 Apr 2022 20:19:12 -0700 (PDT) Message-ID: <6E9FAB4543B7BD25248B817B51F054F6@eigenstate.org> To: 9front@9front.org Date: Sun, 10 Apr 2022 23:19:11 -0400 From: ori@eigenstate.org MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit List-ID: <9front.9front.org> List-Help: X-Glyph: ➈ X-Bullshit: abstract encrypted markup rails Subject: [9front] git/pull: fetch all branches (please test) Reply-To: 9front@9front.org Precedence: bulk there was a diff that went in a while ago to improve this, but it got backed out because it encounters a bug in upstream git -- the spec says that a single ACK should be sent when not using multi-ack modes, but they send back multiple ones. I've got an apparent workaround to fix that, but it's not yet tested enough to commit. Here's the work in progress -- if you can apply it @{cd / && ape/patch -p1} < $patch and let me know if that improves things, that'd be appreciated. There's a chance I may just need to put in a heuristic for when the pack starts, or bite the bullet and implement multi-ack. diff f63d1d3ced81702e0eadf56228a54a467278b0d4 uncommitted --- a/sys/src/cmd/git/fetch.c +++ b/sys/src/cmd/git/fetch.c @@ -186,6 +186,7 @@ int nref, refsz, first; int i, n, req, pfd; vlong packsz; + Objset hadobj; Object *o; nref = 0; @@ -246,13 +247,19 @@ req = 1; } flushpkt(c); + osinit(&hadobj); for(i = 0; i < nref; i++){ - if(hasheq(&have[i], &Zhash)) + if(hasheq(&have[i], &Zhash) || oshas(&hadobj, have[i])) continue; + if((o = readobject(have[i])) == nil) + sysfatal("missing object we should have: %H", have[i]); + osadd(&hadobj, o); + unref(o); n = snprint(buf, sizeof(buf), "have %H\n", have[i]); if(writepkt(c, buf, n + 1) == -1) sysfatal("could not send have for %H", have[i]); } + osclear(&hadobj); if(!req) flushpkt(c); @@ -260,7 +267,7 @@ if(writepkt(c, buf, n) == -1) sysfatal("write: %r"); if(!req) - return 0; + goto showrefs; if(readphase(c) == -1) sysfatal("read: %r"); if((n = readpkt(c, buf, sizeof(buf))) == -1) --- a/sys/src/cmd/git/pull +++ b/sys/src/cmd/git/pull @@ -7,13 +7,10 @@ upstream=$2 url=$3 dir=$4 - bflag=() dflag=() - if(! ~ $#branch 0) - bflag=(-b $branch) if(! ~ $#debug 0) dflag='-d' - {git/fetch $dflag $bflag -u $upstream $url >[2=3] || die $status} | awk ' + {git/fetch $dflag -u $upstream $url >[2=3] || die $status} | awk ' /^remote/{ if($2=="HEAD") next