"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Christian Weisgerber <naddy@mips.inka.de>
Subject:
Re: always fetch remote HEAD except when -b is used
To:
gameoftrees@openbsd.org
Date:
Tue, 14 Feb 2023 16:17:09 +0100

Download raw body.

Thread
Mark Jamsek:

> As discussed with stsp on irc, this tweaks 'got fetch' again so that the
> branch resolved via the remote's HEAD ref is not just a fallback--it is
> always fetched except in the 'got fetch -b branch' case.
> 
> This necessitated passing the bflag to got_fetch_pack from cmd_clone(),
> too, so that we don't fetch HEAD when 'got clone -b branch' is used.

I'm struggling to make sense of the semantics here.

$ got clone -b stable/13 ssh://anongit@git.freebsd.org/src.git
...
$ cd src.git
$ got ref -l | fgrep -v /tags/
HEAD: refs/heads/stable/13
refs/heads/stable/13: acaed6b1e2859cb6726e35e8c937b192c16a95c8
refs/remotes/origin/stable/13: acaed6b1e2859cb6726e35e8c937b192c16a95c8
$ got fetch
...
$ got ref -l | fgrep -v /tags/
HEAD: refs/heads/stable/13
refs/heads/main: 825fbd087e6150eaf601612a5e7468ddc808e004
refs/heads/stable/13: acaed6b1e2859cb6726e35e8c937b192c16a95c8
refs/remotes/origin/HEAD: refs/remotes/origin/main
refs/remotes/origin/main: 825fbd087e6150eaf601612a5e7468ddc808e004
refs/remotes/origin/stable/13: acaed6b1e2859cb6726e35e8c937b192c16a95c8

Presumably, if I limit "clone" to a particular branch, that's all
I'm interested in, and I don't expect the next "fetch" to add the
remote HEAD branch.

-- 
Christian "naddy" Weisgerber                          naddy@mips.inka.de