From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 0NZ5L0bgEWE0xwAAgWs5BA (envelope-from ) for ; Tue, 10 Aug 2021 04:11:18 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id qAYcK0bgEWHiXAAA1q6Kng (envelope-from ) for ; Tue, 10 Aug 2021 02:11:18 +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 2F1A518C59 for ; Tue, 10 Aug 2021 04:11:18 +0200 (CEST) Received: from localhost ([::1]:41050 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mDHEb-0008Pn-8d for larch@yhetil.org; Mon, 09 Aug 2021 22:11:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34658) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mDHEM-0008Pf-Ph for guix-patches@gnu.org; Mon, 09 Aug 2021 22:11:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46570) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mDHEM-0006gF-Fu for guix-patches@gnu.org; Mon, 09 Aug 2021 22:11:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mDHEM-0004Bz-6Y for guix-patches@gnu.org; Mon, 09 Aug 2021 22:11: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: Kyle Meyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Tue, 10 Aug 2021 02:11:02 +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: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: Ricardo Wurmus , 49252@debbugs.gnu.org Received: via spool by 49252-submit@debbugs.gnu.org id=B49252.162856146116109 (code B ref 49252); Tue, 10 Aug 2021 02:11:02 +0000 Received: (at 49252) by debbugs.gnu.org; 10 Aug 2021 02:11:01 +0000 Received: from localhost ([127.0.0.1]:58116 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDHEL-0004Bk-5H for submit@debbugs.gnu.org; Mon, 09 Aug 2021 22:11:01 -0400 Received: from out0.migadu.com ([94.23.1.103]:34148) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDHEG-0004BZ-DL for 49252@debbugs.gnu.org; Mon, 09 Aug 2021 22:10:59 -0400 X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kyleam.com; s=key1; t=1628561454; h=from:from: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: in-reply-to:in-reply-to:references:references; bh=5WWiduhnLh7N0EgPWm/OxfougAI0y+UIp88dseiaX5c=; b=N94X7TOk/UyQ9/2D6/pfB6s20QY6RDPUAp6Yaj6a/Ffq3wDEsrHHO08ID6ID/01PWRsaBm 9mrgaNOy2yZCDk73eWmgIvwXuQmYiclJkEAF2WHQkYJqAewdTFIjkCmnQmZ00wj/ppgw8A 0bCTkZdWHbfdt/B8iaDjMgrnQYqjlnYct7OFvMBZy3XN0LPn/6xgkSk+UJg+zoxPk+UOOk WH6kaWjRI8GkU3PNr40P35KqmCOfgfLBFIgxrlslYSSTo3GbwXgvC6IBwPmLhnpFP+GpJA N2jAKuQgMCLbLo90HdZ88zp61IZ+92ROEhkf4+hifa7f9PYOSCzup7i6ZSi26Q== From: Kyle Meyer In-Reply-To: <87wnovyobb.fsf@gnu.org> References: <87y2auw3jo.fsf@inria.fr> <87fswo8goa.fsf@kyleam.com> <87h7g5p7yi.fsf@gnu.org> <87k0kv8qka.fsf@kyleam.com> <87wnovyobb.fsf@gnu.org> Date: Mon, 09 Aug 2021 22:10:52 -0400 Message-ID: <87h7fyhwwj.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Migadu-Auth-User: kyle@kyleam.com 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=1628561478; 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:dkim-signature; bh=5WWiduhnLh7N0EgPWm/OxfougAI0y+UIp88dseiaX5c=; b=saMyikIVAvam7GQcZn+tXYolAI35up88ywbio9IM7Bmw/c8MncFcbavWh087n3sRuo3iFS fu1JfGPN7p7HtDFn2gBtXJ3aSZja6EnmZq1ARoUpyN4urWEPKI7JnbBkN0ekPwa0shXBsZ q+WyolM7jLwpFh/gRnvYKi5j9rOdmcwzi20VKO3/7UT8Ik4QzXivFRazxzO8HgvrQYR4/D nzX+y+XpYYmtUr9zUHMpLVESOR9845LdfXSlCtOGOlRZzbhbO8mC7vUAndSy88cY0Bf9vP zfOWhosStNeqZLgWBh3KXt6DUvREXcxybFNgPWojTEZHXThW9WgXKs5AkyYBxQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1628561478; a=rsa-sha256; cv=none; b=Ii8uZ4NbObR6Y91Dqd/igfqrUST3ByZdDCDFQlOpsU0yLkCapTqFQcTIjRwK0XuxHZrYQ9 wYSoMc851gd9oKGkTwZf4Z+NV9vf5QLCc4uPwb5JSgaqFVH4qXECpvxsbbQjX7+gXR/G2k qKvQJHDQAzySFRE0+deMAIvfv2ROoqczfCz19U9LVvJB2ksr8b0HFNfUCHQ4xvsk3RJVFH cVkdtWDzk5CW/4kvFPDGyJu7+Verd+Yfdm23+SEONX05ptqrJDsyzPhr6gw2xtpkzWRoBS cGAv0tIsqofXODJrnGuMmk890pYgeAci464YiS8SarW6geyGUa0SPoKJe1wp+g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=kyleam.com header.s=key1 header.b=N94X7TOk; dmarc=none; 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: -1.41 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=kyleam.com header.s=key1 header.b=N94X7TOk; dmarc=none; 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: 2F1A518C59 X-Spam-Score: -1.41 X-Migadu-Scanner: scn0.migadu.com X-TUID: 9+RTgb2HITFM Ludovic Court=C3=A8s writes: > Oh, this must be the reason. If I remove the cached clone: > > rm -rf ~/.cache/guix/checkouts/pjmkglp4t7znuugeurpurzikxq3tnlaywmisyr27= shj7apsnalwq > > 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=99re > missing? It seems that calling =E2=80=98remote-fetch=E2=80=99 is not eno= ugh. 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. [1] In addition to the link I gave upthread, see for some discussion about whether fetch should populate it.