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=0.0 required=5.0 tests=none autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 19870 invoked from network); 4 Jan 2022 18:27:20 -0000 Received: from 4ess.inri.net (216.126.196.42) by inbox.vuxu.org with ESMTPUTF8; 4 Jan 2022 18:27:20 -0000 Received: from mimir.eigenstate.org ([206.124.132.107]) by 4ess; Tue Jan 4 11:38:21 -0500 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 369a89ea (TLSv1.2:ECDHE-RSA-AES256-SHA:256:NO); Tue, 4 Jan 2022 08:37:44 -0800 (PST) Message-ID: <7F9053BC16DE03533DACFC3283504681@eigenstate.org> To: 9front@9front.org, philip.silva@protonmail.com CC: 9front@9front.org Date: Tue, 04 Jan 2022 11:37:43 -0500 From: ori@eigenstate.org In-Reply-To: <87ilv0a9fe.fsf@turtle-trading.net> 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: immutable CMS storage controller Subject: Re: [9front] Git multiple remotes Reply-To: 9front@9front.org Precedence: bulk Quoth Benjamin Riefenstahl : > Hi Philip. > > Thanks for confirming what I thought. So this is what I did (slightly > edited): > > term% cat /.git/config > [core] > repositoryformatversion = p9.0 > [remote "origin"] > url=gits://git.9front.org/plan9front/plan9front > [remote "host"] > url=ssh://benny@host/home/benny/Projects/plan9front > > This URL works from the host with "host" replaced with the actual IP > address. The SSH access from my 9front VM also works with "ssh > benny@host hostname". > > term% git/pull -u host > git/query: resolve: invalid ref remotes/host/front > git/query: resolve: invalid ref remotes/host/front > git/query: resolve: invalid ref remotes/host/front > ours: facb0e757ac63f763bd942a2714f979538b99eb0 > git/query: resolve: invalid ref remotes/host/front > theirs: > git/query: resolve: invalid ref remotes/host/front > common: > git/merge remotes/host/front > > term% git/branch -a > heads/front > remotes/THEM/front > remotes/origin/front > > I expected remotes/host/front in that list. git/pull also seems to > expect that, s.a. > > term% git/query origin/front front host/front > git/query: resolve: invalid ref host/front > > term% git/query origin/front front > acc504c319a4b4188479cfa602e40cb6851c0528 > facb0e757ac63f763bd942a2714f979538b99eb0 > > Note that host/front is actually at f63d1d3ce at this time. > > I try an explict fetch: > > term% cd / > term% git/fetch -u host ssh://benny@host/home/benny/Projects/plan9front > uri: "ssh://benny@host/home/benny/Projects/plan9front" > symref HEAD refs/heads/front > > But this does not change anything. > > Anything else I could try or add? > > TIA, benny > by default, we don't fetch all remote branches; 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