From debbugs-submit-bounces@debbugs.gnu.org Mon Aug 09 05:12:21 2021 Received: (at 49252) by debbugs.gnu.org; 9 Aug 2021 09:12:21 +0000 Received: from localhost ([127.0.0.1]:55739 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mD1KW-0000iw-QX for submit@debbugs.gnu.org; Mon, 09 Aug 2021 05:12:21 -0400 Received: from eggs.gnu.org ([209.51.188.92]:57310) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mD1KU-0000ii-0F for 49252@debbugs.gnu.org; Mon, 09 Aug 2021 05:12:19 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:34390) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mD1KN-0000cB-7u; Mon, 09 Aug 2021 05:12:11 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=45038 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mD1KM-0005f8-VJ; Mon, 09 Aug 2021 05:12:11 -0400 From: =?utf-8?Q?Ludovic_Court=C3=A8s?= To: Kyle Meyer Subject: Re: [bug#49252] [PATCH] Channels defaulting to HEAD instead of =?utf-8?B?4oCYbWFzdGVy4oCZ?= References: <87y2auw3jo.fsf@inria.fr> <87fswo8goa.fsf@kyleam.com> <87h7g5p7yi.fsf@gnu.org> <87k0kv8qka.fsf@kyleam.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 22 Thermidor an 229 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-pc-linux-gnu Date: Mon, 09 Aug 2021 11:12:08 +0200 In-Reply-To: <87k0kv8qka.fsf@kyleam.com> (Kyle Meyer's message of "Sun, 08 Aug 2021 19:28:05 -0400") Message-ID: <87wnovyobb.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 49252 Cc: Ricardo Wurmus , 49252@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Hello Kyle, Kyle Meyer skribis: > Ludovic Court=C3=A8s writes: > >> Kyle Meyer skribis: > [...] >>> >>> Hmm, it looks like it's there: >>> >>> $ git ls-remote https://git.savannah.gnu.org/git/guix.git | grep HEAD >>> e499500730de23fd54ae63696a725d4b90a406d7 HEAD >>> >>> $ git clone https://git.savannah.gnu.org/git/guix.git && cd guix >>> $ git for-each-ref refs/remotes/origin | grep HEAD >>> e499500730de23fd54ae63696a725d4b90a406d7 commit refs/remotes/origin/H= EAD >>> $ git name-rev refs/remotes/origin/HEAD >>> refs/remotes/origin/HEAD master >> >> OK, so something else must be at fault. >> >> Ideas? > > My understanding is that the clone is happening through guile-git, which > uses libgit2. In libgit2's v1.1.0 release notes, I see "[t]he > refs/remotes/origin/HEAD file will be created at clone time to point to > the origin's default branch". So my current guess is that this clone > was made before guix's libgit2 was 1.1.0. > > Does that sound possible (i.e. this clone is from before 2020-12-ish)? > Do you still see the "reference 'refs/remotes/origin/HEAD' not found" > failure if you force a fresh clone? Oh, this must be the reason. If I remove the cached clone: rm -rf ~/.cache/guix/checkouts/pjmkglp4t7znuugeurpurzikxq3tnlaywmisyr27sh= j7apsnalwq and then clone again, it works: --8<---------------cut here---------------start------------->8--- scheme@(guile-user)> ,use(guix git) scheme@(guile-user)> (update-cached-checkout "https://git.savannah.gnu.org/= git/guix.git") $2 =3D "/home/ludo/.cache/guix/checkouts/pjmkglp4t7znuugeurpurzikxq3tnlaywm= isyr27shj7apsnalwq" $3 =3D "30289f4d4638452520f52c1a36240220d0d940ff" $4 =3D #f --8<---------------cut here---------------end--------------->8--- Likewise with the other repo Ricardo mentions: --8<---------------cut here---------------start------------->8--- scheme@(guile-user)> (update-cached-checkout "https://github.com/ImmuneDyna= mics/Spectre") $5 =3D "/home/ludo/.cache/guix/checkouts/lpz4iyuu3pztx73ks74bfiymewyzn24rm5= 65l6cgiutvjow5joka" $6 =3D "742ebc4bc09ce69b970eceb78291bdbf5229d20d" $7 =3D #f --8<---------------cut here---------------end--------------->8--- I suppose we need to add a call to fetch remote heads when they=E2=80=99re missing? It seems that calling =E2=80=98remote-fetch=E2=80=99 is not enoug= h. If I explicitly remove =E2=80=98HEAD=E2=80=99 from the clone, then I get: --8<---------------cut here---------------start------------->8--- scheme@(guile-user)> (define r (repository-open "/home/ludo/.cache/guix/che= ckouts/lpz4iyuu3pztx73ks74bfiymewyzn24rm565l6cgiutvjow5joka")) scheme@(guile-user)> (reference-name->oid r "refs/remotes/origin/HEAD") ice-9/boot-9.scm:1685:16: In procedure raise-exception: Git error: reference 'refs/remotes/origin/HEAD' not found Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. scheme@(guile-user) [1]> ,q scheme@(guile-user)> (remote-fetch (remote-lookup r "origin")) scheme@(guile-user)> (reference-name->oid r "refs/remotes/origin/HEAD") ice-9/boot-9.scm:1685:16: In procedure raise-exception: Git error: reference 'refs/remotes/origin/HEAD' not found Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. scheme@(guile-user) [1]> ,q --8<---------------cut here---------------end--------------->8--- Calling =E2=80=98remote-ls=E2=80=99 doesn=E2=80=99t populate that file eith= er: --8<---------------cut here---------------start------------->8--- scheme@(guile-user)> (define o (remote-lookup r "origin")) scheme@(guile-user)> (remote-connect o) scheme@(guile-user)> (remote-ls o) $13 =3D (#< local: 0 oid: # loid: # name: "HE= AD" symref-target: 73408368> #< local: 0 oid: # loid: # name: "refs/heads/development" symref-target: 0> #<= local: 0 oid: # loid: # name: "refs/heads/master" symref-= target: 0> #< local: 0 oid: # loid: # name: "= refs/heads/pre-release" symref-target: 0> [=E2=80=A6]) --8<---------------cut here---------------end--------------->8--- So I=E2=80=99m not sure what the best approach is. Thoughts? Ludo=E2=80=99.