From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id o1TcCTQzEmFoWQEAgWs5BA (envelope-from ) for ; Tue, 10 Aug 2021 10:05:08 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id aH3tBDQzEmFmXwAAB5/wlQ (envelope-from ) for ; Tue, 10 Aug 2021 08:05:08 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id CAD6DEE7B for ; Tue, 10 Aug 2021 10:05:07 +0200 (CEST) Received: from localhost ([::1]:44772 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mDMl0-0006Xk-TY for larch@yhetil.org; Tue, 10 Aug 2021 04:05:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59258) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mDMkw-0006XM-CO for guix-patches@gnu.org; Tue, 10 Aug 2021 04:05:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46845) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mDMkw-0005LU-5x for guix-patches@gnu.org; Tue, 10 Aug 2021 04:05:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mDMkw-0004nJ-0z for guix-patches@gnu.org; Tue, 10 Aug 2021 04:05:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49252] [PATCH] Channels defaulting to HEAD instead of =?UTF-8?Q?=E2=80=98master=E2=80=99?= Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 10 Aug 2021 08:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49252 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Kyle Meyer Cc: Ricardo Wurmus , 49252@debbugs.gnu.org Received: via spool by 49252-submit@debbugs.gnu.org id=B49252.162858267418387 (code B ref 49252); Tue, 10 Aug 2021 08:05:01 +0000 Received: (at 49252) by debbugs.gnu.org; 10 Aug 2021 08:04:34 +0000 Received: from localhost ([127.0.0.1]:58391 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDMkT-0004mT-Jl for submit@debbugs.gnu.org; Tue, 10 Aug 2021 04:04:33 -0400 Received: from eggs.gnu.org ([209.51.188.92]:50416) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDMkR-0004mG-8A for 49252@debbugs.gnu.org; Tue, 10 Aug 2021 04:04:32 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:41556) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mDMkL-0004qx-50; Tue, 10 Aug 2021 04:04:25 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=45048 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mDMkK-0007jT-RO; Tue, 10 Aug 2021 04:04:25 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87y2auw3jo.fsf@inria.fr> <87fswo8goa.fsf@kyleam.com> <87h7g5p7yi.fsf@gnu.org> <87k0kv8qka.fsf@kyleam.com> <87wnovyobb.fsf@gnu.org> <87h7fyhwwj.fsf@kyleam.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 23 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: Tue, 10 Aug 2021 10:04:22 +0200 In-Reply-To: <87h7fyhwwj.fsf@kyleam.com> (Kyle Meyer's message of "Mon, 09 Aug 2021 22:10:52 -0400") Message-ID: <87r1f1sp2x.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-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1628582707; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=k8vExbZBMlkaf7mIUl+Dw5oD3N5uev92A7vpK4Wqsj8=; b=Vt69Ykgh0F8KhHrJfrzdyhpLBQG4ELFWh/E0kmSmR8PImuJMUzC8CboOCK8yYON4m5rg60 73zyzyCmHqNGF6fiM9hypVBx8MUgBP7vpwIAQElf3WO85A5Qa/TLUQYxG1IHWPkRpUE+op HbV3s3t1nigCBs5bqe7R/pxSA3E20++4sC843iDuw41OjNAn7Qs3kql4egICSX6aKy6zhl keiHWnXT+C1UiHCi59fSFqoayhjhv6HR4xW0Xfst0lkS3XECeKDfJUaoc+Y6xnrKjxlALL S7YMGj2Ib8D7hkSwKEBJp7H0Wy6lsx5RPt8zA+u9ISlKuAkp+ZZCBmnwK3ADbg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1628582707; a=rsa-sha256; cv=none; b=Q8Y7OtRvwfpc7ea8nuIAM63rm3J8uBAtC+LuiAXogjvp/9UIha3dqrjApeY9SA61ORiJJm Fl8UwZVJ+Fb1eFIj1La4HzuqVpwIcigIWNgBjcZAkVxz3mZctVndgB7nLSQuioffKbFFPm D8TeByT1py2mtUS8O6SZlMn6iok7wwNx6Br1S3Kje50SpCWOyOJIUt9orBEv07havqJ3+Y iLvOd+PegJbit5C1Yd38lA/2NF7GsXsSnNWngdQACMdIOvCKvQOzggGqfk+Qg6bvYrCy5x 1SkuLwPXWp4FwGw91h8ZSgAacvDuJEqLQb/Y9DuXRV5tsqY8s2krO0IIzwJcjw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: -2.91 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: CAD6DEE7B X-Spam-Score: -2.91 X-Migadu-Scanner: scn1.migadu.com X-TUID: hbzYvTfNZvlZ Kyle Meyer skribis: > Ludovic Court=C3=A8s writes: > >> Oh, this must be the reason. If I remove the cached clone: >> >> rm -rf ~/.cache/guix/checkouts/pjmkglp4t7znuugeurpurzikxq3tnlaywmisyr2= 7shj7apsnalwq >> >> and then clone again, it works: > > Great, glad that that mystery is solved. > >> I suppose we need to add a call to fetch remote heads when they=E2=80=99= re >> missing? It seems that calling =E2=80=98remote-fetch=E2=80=99 is not en= ough. > > Right, a fetch won't do it [1]. Users are free to delete or redirect > refs/remotes//HEAD, and a fetch won't repopulate it. > > On the command line, you can query the remote and recreate the symref > with `remote set-head -a': > > $ git symbolic-ref -d refs/remotes/origin/HEAD > $ git symbolic-ref refs/remotes/origin/HEAD > fatal: ref refs/remotes/origin/HEAD is not a symbolic ref > $ git remote set-head origin -a > origin/HEAD set to master > $ git symbolic-ref refs/remotes/origin/HEAD > refs/remotes/origin/master > > In the libgit2 world, I think the most direct path might be something > along the lines of "get remote ref via git_remote_default_branch()" > followed by "create refs/remotes//HEAD via > git_reference_symbolic_create()". I'm not spotting either of those > functions in guile-git, though. > > I haven't confirmed but based on the "symref-target" in the remote-ls > output you showed... > >> --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: = "HEAD" symref-target: 73408368> [...] > > ... I guess it might be possible to determine the ref target with > remote-ls. In that case, it'd just be the > git_reference_symbolic_create() wrapper that was missing. Right. We can add the missing procedures in Guile-Git, but in the meantime, maybe we could create .git/refs/origin/HEAD =E2=80=9Cby hand=E2= =80=9D? The advantage is that we wouldn=E2=80=99t have to wait for the new Guile-Git release; but OTOH, we=E2=80=99re the ones making the Guile-Git release, too= =E2=80=A6 Thanks, Ludo=E2=80=99.