From unknown Fri Jun 13 11:27:01 2025 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: rekado@elephly.net, kyle@kyleam.com, guix-patches@gnu.org Resent-Date: Mon, 28 Jun 2021 12:57:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 49252 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49252@debbugs.gnu.org Cc: Ricardo Wurmus , Kyle Meyer X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: Ricardo Wurmus , Kyle Meyer Received: via spool by submit@debbugs.gnu.org id=B.162488501124317 (code B ref -1); Mon, 28 Jun 2021 12:57:01 +0000 Received: (at submit) by debbugs.gnu.org; 28 Jun 2021 12:56:51 +0000 Received: from localhost ([127.0.0.1]:51260 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxqol-0006K9-9K for submit@debbugs.gnu.org; Mon, 28 Jun 2021 08:56:51 -0400 Received: from lists.gnu.org ([209.51.188.17]:34630) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lxqoh-0006Jx-SX for submit@debbugs.gnu.org; Mon, 28 Jun 2021 08:56:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34260) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxqoh-0000Z7-Hu for guix-patches@gnu.org; Mon, 28 Jun 2021 08:56:47 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:37434) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lxqoh-0003Gj-Ar for guix-patches@gnu.org; Mon, 28 Jun 2021 08:56:47 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=36586 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxqog-0004lY-77 for guix-patches@gnu.org; Mon, 28 Jun 2021 08:56:46 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 10 Messidor 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, 28 Jun 2021 14:56:43 +0200 Message-ID: <87y2auw3jo.fsf@inria.fr> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -2.3 (--) 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 (---) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, With an eye on allowing channel authors, and Guix in particular, to eventually be able to choose a default branch name other than =E2=80=98mast= er=E2=80=99, what about changing defaults like this: --=-=-= Content-Type: text/x-patch Content-Disposition: inline diff --git a/guix/channels.scm b/guix/channels.scm index 476d62e1f4..a5283b4bf4 100644 --- a/guix/channels.scm +++ b/guix/channels.scm @@ -122,7 +122,7 @@ channel? (name channel-name) (url channel-url) - (branch channel-branch (default "master")) + (branch channel-branch (default #f)) (commit channel-commit (default #f)) (introduction channel-introduction (default #f)) (location channel-location @@ -179,7 +179,6 @@ to the corresponding bytevector." (define %default-guix-channel (channel (name 'guix) - (branch "master") (url %default-channel-url) (introduction %guix-channel-introduction))) @@ -225,7 +224,9 @@ introduction, add it." "Return the \"reference\" for CHANNEL, an sexp suitable for 'latest-repository-commit'." (match (channel-commit channel) - (#f `(branch . ,(channel-branch channel))) + (#f (if (channel-branch channel) + `(branch . ,(channel-branch channel)) + '())) ;remote HEAD (commit `(commit . ,(channel-commit channel))))) (define sexp->channel-introduction diff --git a/guix/inferior.scm b/guix/inferior.scm index 7c8e478f2a..3db63167fd 100644 --- a/guix/inferior.scm +++ b/guix/inferior.scm @@ -732,7 +732,10 @@ prefix, resolve it; and if 'commit' is unset, fetch CHANNEL's branch tip." (branch (channel-branch channel))) (if (and commit (= (string-length commit) 40)) commit - (let* ((ref (if commit `(commit . ,commit) `(branch . ,branch))) + (let* ((ref (cond + (commit `(commit . ,commit)) + (branch `(branch . ,branch)) + (else '()))) ;remote HEAD (cache commit relation (update-cached-checkout (channel-url channel) #:ref ref --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable For the record, commit cb41c15827a2e910aa56fb5d1917ba8a085c95c7 by Kyle (Cc=E2=80=99d) gives the ability to use the remote HEAD by default, which is exactly what we need here. Unfortunately, for the Guix repo at Savannah, I get: --8<---------------cut here---------------start------------->8--- $ ./pre-inst-env guix time-machine -- describe guix time-machine: error: Git error: reference 'refs/remotes/origin/HEAD' n= ot found --8<---------------cut here---------------end--------------->8--- =E2=80=A6 but it works for . Presumably we have a server-side setup issue at Savannah? Are there downsides, or cases where it might pick the wrong branch? Thoughts? Ludo=E2=80=99. --=-=-=-- From unknown Fri Jun 13 11:27:01 2025 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: Fri, 09 Jul 2021 00:39: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.162579113415836 (code B ref 49252); Fri, 09 Jul 2021 00:39:02 +0000 Received: (at 49252) by debbugs.gnu.org; 9 Jul 2021 00:38:54 +0000 Received: from localhost ([127.0.0.1]:57898 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m1eXd-00047M-SK for submit@debbugs.gnu.org; Thu, 08 Jul 2021 20:38:54 -0400 Received: from out2.migadu.com ([188.165.223.204]:12766) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m1eXa-00047A-2c for 49252@debbugs.gnu.org; Thu, 08 Jul 2021 20:38:52 -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=1625791128; 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=TgcRn5+/bkHbfvnbGeIgDlquYPvEWMtbwGx5JF8YhSs=; b=dxFflbhf97NCb1R8m23sN4dx2450qWPl6E6kI+B7Emc5YKIF2t/SxlQToXGzrOsoZrpX9J x/VIWKml27gLvnCJcK3nqtLHNhiJvuwkb/kbNq7UlKHwnxJuz7q9hM0HVU12fMm+gCrGzO tpG/4N9ym5yIEj9WbnfpzkRi/K1YP805RU6MJNEyHrNp85YVIIZJGtyHBqBaiyD083QkKe Cevk6Pvb0ZbRv6+xrHavuJXXdwvdA5P7Yp02qSNl8Yp46OdyLZLUPKdMG6bQs7s/kKkf4z yi5yno6C7C9sbofrG5wk0qBfMJ6Slx1LXKav8TkLC26u9+YV7Og9xarY2OxTxA== From: Kyle Meyer In-Reply-To: <87y2auw3jo.fsf@inria.fr> References: <87y2auw3jo.fsf@inria.fr> Date: Thu, 08 Jul 2021 20:38:45 -0400 Message-ID: <87fswo8goa.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: kyle@kyleam.com X-Spam-Score: 0.0 (/) 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: -1.0 (-) Ludovic Court=C3=A8s writes: > For the record, commit cb41c15827a2e910aa56fb5d1917ba8a085c95c7 by Kyle > (Cc=E2=80=99d) gives the ability to use the remote HEAD by default, which= is > exactly what we need here. > > Unfortunately, for the Guix repo at Savannah, I get: > > --8<---------------cut here---------------start------------->8--- > $ ./pre-inst-env guix time-machine -- describe > guix time-machine: error: Git error: reference 'refs/remotes/origin/HEAD'= not found > --8<---------------cut here---------------end--------------->8--- > > =E2=80=A6 but it works for . > > Presumably we have a server-side setup issue at Savannah? 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/HEAD $ git name-rev refs/remotes/origin/HEAD refs/remotes/origin/HEAD master This might be a long shot, but if you cloned the repo with magit-clone, it has some custom logic that deletes refs/remotes//HEAD unless magit-clone-set-remote-head is non-nil (and it's nil by default). > Are there downsides, or cases where it might pick the wrong branch? The main downside I can think of is what I mentioned in bug#45187 (87v9d8dk0r.fsf@kyleam.com): [The remote HEAD symref] probably the best indicator of what the primary branch is. In a clone, it doesn't necessarily match HEAD on the remote, because users may change it to another branch they're interested in, but that isn't really relevant to these behind-the-scenes checkouts. So, if it's a user-facing clone, refs/remotes/origin/HEAD isn't a reliable indicator because users are free to redirect the remote HEAD symref to another branch of interest [*] or to delete it altogether. I think channel clones would fall into the "behind the scenes" category, though, right? [*] This is discussed here: https://lore.kernel.org/git/xmqqlfivwvtw.fsf@gitster.c.googlers.com/ From unknown Fri Jun 13 11:27:01 2025 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: Wed, 04 Aug 2021 15: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.162808947230548 (code B ref 49252); Wed, 04 Aug 2021 15:05:01 +0000 Received: (at 49252) by debbugs.gnu.org; 4 Aug 2021 15:04:32 +0000 Received: from localhost ([127.0.0.1]:44927 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBIRb-0007wd-LF for submit@debbugs.gnu.org; Wed, 04 Aug 2021 11:04:31 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59182) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mBIRa-0007wS-By for 49252@debbugs.gnu.org; Wed, 04 Aug 2021 11:04:30 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:33790) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mBIRT-0002gF-Na; Wed, 04 Aug 2021 11:04:23 -0400 Received: from [2001:660:6102:320:e120:2c8f:8909:cdfe] (port=43034 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mBIRT-0000WC-5j; Wed, 04 Aug 2021 11:04:23 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <87y2auw3jo.fsf@inria.fr> <87fswo8goa.fsf@kyleam.com> X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 17 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: Wed, 04 Aug 2021 17:04:21 +0200 In-Reply-To: <87fswo8goa.fsf@kyleam.com> (Kyle Meyer's message of "Thu, 08 Jul 2021 20:38:45 -0400") Message-ID: <87h7g5p7yi.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-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 (---) Hi Kyle, Kyle Meyer skribis: > Ludovic Court=C3=A8s writes: > >> For the record, commit cb41c15827a2e910aa56fb5d1917ba8a085c95c7 by Kyle >> (Cc=E2=80=99d) gives the ability to use the remote HEAD by default, whic= h is >> exactly what we need here. >> >> Unfortunately, for the Guix repo at Savannah, I get: >> >> --8<---------------cut here---------------start------------->8--- >> $ ./pre-inst-env guix time-machine -- describe >> guix time-machine: error: Git error: reference 'refs/remotes/origin/HEAD= ' not found >> --8<---------------cut here---------------end--------------->8--- >> >> =E2=80=A6 but it works for . >> >> Presumably we have a server-side setup issue at Savannah? > > 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/HEAD > $ git name-rev refs/remotes/origin/HEAD > refs/remotes/origin/HEAD master OK, so something else must be at fault. Ideas? > This might be a long shot, but if you cloned the repo with magit-clone, > it has some custom logic that deletes refs/remotes//HEAD unless > magit-clone-set-remote-head is non-nil (and it's nil by default). No, these are clones managed via (guix git) only. >> Are there downsides, or cases where it might pick the wrong branch? > > The main downside I can think of is what I mentioned in bug#45187 > (87v9d8dk0r.fsf@kyleam.com): > > [The remote HEAD symref] probably the best indicator of what the > primary branch is. In a clone, it doesn't necessarily match HEAD on > the remote, because users may change it to another branch they're > interested in, but that isn't really relevant to these > behind-the-scenes checkouts. > > So, if it's a user-facing clone, refs/remotes/origin/HEAD isn't a > reliable indicator because users are free to redirect the remote HEAD > symref to another branch of interest [*] or to delete it altogether. > > I think channel clones would fall into the "behind the scenes" category, > though, right? Right, those cached clones managed by (guix git) are behind the scenes; we can assume only (guix git) will only ever touch them. Thanks, Ludo=E2=80=99. From unknown Fri Jun 13 11:27:01 2025 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: Ricardo Wurmus Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 08 Aug 2021 13:55: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: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: Kyle Meyer , 49252@debbugs.gnu.org Received: via spool by 49252-submit@debbugs.gnu.org id=B49252.162843084915003 (code B ref 49252); Sun, 08 Aug 2021 13:55:01 +0000 Received: (at 49252) by debbugs.gnu.org; 8 Aug 2021 13:54:09 +0000 Received: from localhost ([127.0.0.1]:53823 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mCjFh-0003tu-BV for submit@debbugs.gnu.org; Sun, 08 Aug 2021 09:54:09 -0400 Received: from sender4-of-o51.zoho.com ([136.143.188.51]:21147) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mCjFd-0003ti-GO for 49252@debbugs.gnu.org; Sun, 08 Aug 2021 09:54:08 -0400 ARC-Seal: i=1; a=rsa-sha256; t=1628430834; cv=none; d=zohomail.com; s=zohoarc; b=MEYbCYv9/ALXR4rmTBAs1T6jnAVrhvzWoo7O1xuoPqC0TA8LY60msZliS3c2r94Tgi1MP8DRB93Is/UtW6BRhe1AgSkJbWtce+kjmlE47pW7zyDYdSdVHWGeAb8dEyYRs4sA1nMnKxChtvAqPIdYzhgVpgzmauLKJKOA7mbD0g4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1628430834; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=8RIYCFAx0K2eVi3PZff5cQvQW1/vybM0Gu4TjdHVoR8=; b=GlVIodcS0AVfblkGc6p6glygKRqdvKEL8P5B/txjWzPfdY7XWYOUMfKjmaQGe3GP8IRf9bJPMs+19vtRIroW+B2ytNC5AuWwS4FZWwXD+z1lM1wYYrvQDI/PRUse5tJPDmEwMwp499FcrX/da/+ITHJaNFAbwbLQJskrISxxZlE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=elephly.net; spf=pass smtp.mailfrom=rekado@elephly.net; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1628430834; s=zoho; d=elephly.net; i=rekado@elephly.net; h=References:From:To:Cc:Subject:In-reply-to:Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=8RIYCFAx0K2eVi3PZff5cQvQW1/vybM0Gu4TjdHVoR8=; b=i5k4hU+xShBayKSiMTlH3EEExsYlRRCoBKaU8QKhw5A4Z5NDTlzOB71gWX9OVc/6 mUu+52U+zO2vbEzJd0eRnS6PMLmTX/pNf9DYqVPwW8n788yKp6AKX4lIg9F1bgdFeNT KfADNultFFS4loHglkzmE/JV7swe5SIvkFQKqcRc= Received: from localhost (p54ad4ea5.dip0.t-ipconnect.de [84.173.78.165]) by mx.zohomail.com with SMTPS id 162843083183143.647378345185075; Sun, 8 Aug 2021 06:53:51 -0700 (PDT) References: <87y2auw3jo.fsf@inria.fr> User-agent: mu4e 1.4.15; emacs 27.2 From: Ricardo Wurmus In-reply-to: <87y2auw3jo.fsf@inria.fr> X-URL: https://elephly.net X-PGP-Key: https://elephly.net/rekado.pubkey X-PGP-Fingerprint: BCA6 89B6 3655 3801 C3C6 2150 197A 5888 235F ACAC Date: Sun, 08 Aug 2021 15:53:48 +0200 Message-ID: <87tuk0kpoz.fsf@elephly.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-ZohoMailClient: External X-Spam-Score: -0.0 (/) 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: -1.0 (-) Ludovic Court=C3=A8s writes: > For the record, commit cb41c15827a2e910aa56fb5d1917ba8a085c95c7=20 > by Kyle > (Cc=E2=80=99d) gives the ability to use the remote HEAD by default,=20 > which is > exactly what we need here. > > Unfortunately, for the Guix repo at Savannah, I get: > > --8<---------------cut=20 > here---------------start------------->8--- > $ ./pre-inst-env guix time-machine -- describe > guix time-machine: error: Git error: reference=20 > 'refs/remotes/origin/HEAD' not found > --8<---------------cut=20 > here---------------end--------------->8--- > > =E2=80=A6 but it works for . For what it=E2=80=99s worth I found the same kind of problem when=20 importing an R package from Github: ./pre-inst-env guix import cran -a git=20 https://github.com/ImmuneDynamics/Spectre Here=E2=80=99s the error backtrace: --8<---------------cut here---------------start------------->8--- Backtrace: In ice-9/boot-9.scm: 724:2 19 (call-with-prompt _ _ #) In ice-9/eval.scm: 619:8 18 (_ #(#(#))) In guix/ui.scm: 2185:7 17 (run-guix . _) 2148:10 16 (run-guix-command _ . _) In guix/scripts/import.scm: 120:11 15 (guix-import . _) In guix/scripts/import/cran.scm: 110:25 14 (guix-import-cran . _) In guix/memoization.scm: 98:0 13 (mproc "https://github.com/ImmuneDynamics/Spectre"=20 #:repo git) In unknown file: 12 (_ # #=20 (this is nothing)) In guix/import/cran.scm: 594:24 11 (_ "https://github.com/ImmuneDynamics/Spectre" #:repo=20 _ #:version _) 279:25 10 (fetch-description _=20 "https://github.com/ImmuneDynamics/Spectre") In guix/memoization.scm: 98:0 9 (mproc "https://github.com/ImmuneDynamics/Spectre"=20 #:method git) In unknown file: 8 (_ # #=20 (this is nothing)) In ice-9/boot-9.scm: 1752:10 7 (with-exception-handler _ _ #:unwind? _=20 #:unwind-for-type _) In guix/store.scm: 658:37 6 (thunk) In guix/git.scm: 481:8 5 (latest-repository-commit # "https://github.com/ImmuneDynamics/Spectre"=20 #:recursive? _ #:log-port _ #:cache-directory _ #:ref _) 247:4 4 (update-cached-checkout _ #:ref _ #:recursive? _=20 #:check-out? _ #:starting-commit _ #:log-port _=20 #:cache-directory _) 214:18 3 (resolve _) In git/reference.scm: 60:8 2 (_ _ _) In git/bindings.scm: 77:2 1 (raise-git-error _) In ice-9/boot-9.scm: 1685:16 0 (raise-exception _ #:continuable? _) ice-9/boot-9.scm:1685:16: In procedure raise-exception: Git error: reference 'refs/remotes/origin/HEAD' not found --8<---------------cut here---------------end--------------->8--- > Presumably we have a server-side setup issue at Savannah? I think it might be a repository setting rather than a server=20 setting as other Github repositories work, yet this one repo on=20 Github does not. --=20 Ricardo From unknown Fri Jun 13 11:27:01 2025 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: Sun, 08 Aug 2021 23:09: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: Ricardo Wurmus Cc: Ludovic =?UTF-8?Q?Court=C3=A8s?= , 49252@debbugs.gnu.org Received: via spool by 49252-submit@debbugs.gnu.org id=B49252.1628464095763 (code B ref 49252); Sun, 08 Aug 2021 23:09:02 +0000 Received: (at 49252) by debbugs.gnu.org; 8 Aug 2021 23:08:15 +0000 Received: from localhost ([127.0.0.1]:54925 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mCrtv-0000CF-Kw for submit@debbugs.gnu.org; Sun, 08 Aug 2021 19:08:15 -0400 Received: from out0.migadu.com ([94.23.1.103]:29945) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mCrtp-0000C3-UU for 49252@debbugs.gnu.org; Sun, 08 Aug 2021 19:08:14 -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=1628464088; 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=bQah+k/CFLK2YqJ1w/jdTKsMNIBry1PepJXi9lmFTmo=; b=laabB9I1FfDdbBoWmII6ZHbIRXAYEXuBejFoP27zLspn3TcESH3kdd6EICBZ5mutNtg0rh ingB+o/fdCt1+j9tbvDmf6S7Uw4E3n0+X5YGYgzpUmCml1ENgS7CCfzxX8dOo771Z5a6Hk kSoEIa1nENjtEIDuOEnbBMDlna1vWHF7wFOflunruZBEes1IwI66t53fsyD6o1/9xFCwsQ 2AjUWS2AgKSkXlQiCGwrBPtVbCIKn8XMLE5sAMqe65wVwTxHfSmgyTpk6m6MCMWCZjEg68 Bq4lzylJUp3KomqAvEvYvOe9wb2SbhdQYHSrb6Y5hf+xGNBYac50O96Y/WDeAw== From: Kyle Meyer In-Reply-To: <87tuk0kpoz.fsf@elephly.net> References: <87y2auw3jo.fsf@inria.fr> <87tuk0kpoz.fsf@elephly.net> Date: Sun, 08 Aug 2021 19:08:06 -0400 Message-ID: <87mtpr8rhl.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: kyle@kyleam.com X-Spam-Score: -0.7 (/) 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: -1.7 (-) Ricardo Wurmus writes: > For what it=E2=80=99s worth I found the same kind of problem when=20 > importing an R package from Github: > > ./pre-inst-env guix import cran -a git=20 > https://github.com/ImmuneDynamics/Spectre > > Here=E2=80=99s the error backtrace: [...] > > ice-9/boot-9.scm:1685:16: In procedure raise-exception: > Git error: reference 'refs/remotes/origin/HEAD' not found > --8<---------------cut here---------------end--------------->8--- > >> Presumably we have a server-side setup issue at Savannah? > > I think it might be a repository setting rather than a server=20 > setting as other Github repositories work, yet this one repo on=20 > Github does not. Hmm, I'm not sure what's going on here, but, as with , if I clone the above repo via `git clone', refs/remotes/origin/HEAD is there: $ git ls-remote https://github.com/ImmuneDynamics/Spectre | grep HEAD 742ebc4bc09ce69b970eceb78291bdbf5229d20d HEAD $ git clone https://github.com/ImmuneDynamics/Spectre && cd Spectre $ git for-each-ref refs/remotes/origin | grep HEAD 742ebc4bc09ce69b970eceb78291bdbf5229d20d commit refs/remotes/origin/HEAD From unknown Fri Jun 13 11:27:01 2025 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: Sun, 08 Aug 2021 23:29: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: 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.16284652902562 (code B ref 49252); Sun, 08 Aug 2021 23:29:01 +0000 Received: (at 49252) by debbugs.gnu.org; 8 Aug 2021 23:28:10 +0000 Received: from localhost ([127.0.0.1]:54941 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mCsDC-0000fG-2l for submit@debbugs.gnu.org; Sun, 08 Aug 2021 19:28:10 -0400 Received: from out1.migadu.com ([91.121.223.63]:41179) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mCsDA-0000f7-FM for 49252@debbugs.gnu.org; Sun, 08 Aug 2021 19:28:09 -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=1628465286; 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=L4peNXilfvPJNk81AET5TFEy8P3NhGAZLxXqrb3LoQI=; b=m5wopfA45v32uVEw4MAEFt1w3TwBEx3QUeZLt3Xe7vJrcvqCJqIF5LzGR1m9azKuS14UdI Ks+RgcjB12xDF8p1w4WpY7w+Ke/7ZZKDseXj2Fkvxnev+bsKziDgTDfjf7T3jLC3zGu1Pb fU4eZaOVVykPzmv/j0gXNrBdwaiHROeG97JaZk5/0/DVMNwSFxxvRzdxM4T2YVqxD6RJSc fR3vcHiaffw8BtLY2Mtv515fP5my2m8UAKZXnm/YYPKbnoHtjNTqqIwjldrurGVvmlW70o U3ri8ibeKshERcLF92MkN5+MLbWhpmlLDkAJ0+APcFt7IZ2rY4FHiWsexiO/4A== From: Kyle Meyer In-Reply-To: <87h7g5p7yi.fsf@gnu.org> References: <87y2auw3jo.fsf@inria.fr> <87fswo8goa.fsf@kyleam.com> <87h7g5p7yi.fsf@gnu.org> Date: Sun, 08 Aug 2021 19:28:05 -0400 Message-ID: <87k0kv8qka.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: kyle@kyleam.com X-Spam-Score: -0.7 (/) 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: -1.7 (-) 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/HE= AD >> $ 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? From unknown Fri Jun 13 11:27:01 2025 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: Mon, 09 Aug 2021 09:13: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.16285003412791 (code B ref 49252); Mon, 09 Aug 2021 09:13:01 +0000 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: Ludovic =?UTF-8?Q?Court=C3=A8s?= 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-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. From unknown Fri Jun 13 11:27:01 2025 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-Flow: FLOW_OUT X-Migadu-Auth-User: kyle@kyleam.com X-Spam-Score: -0.7 (/) 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: -1.7 (-) 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. From unknown Fri Jun 13 11:27:01 2025 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-Spam-Score: -2.3 (--) 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 (---) 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. From unknown Fri Jun 13 11:27:01 2025 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: Wed, 11 Aug 2021 00:36: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: 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.162864211220174 (code B ref 49252); Wed, 11 Aug 2021 00:36:01 +0000 Received: (at 49252) by debbugs.gnu.org; 11 Aug 2021 00:35:12 +0000 Received: from localhost ([127.0.0.1]:32819 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDcD6-0005FC-7t for submit@debbugs.gnu.org; Tue, 10 Aug 2021 20:35:12 -0400 Received: from out0.migadu.com ([94.23.1.103]:52141) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mDcD0-0005Ej-JM for 49252@debbugs.gnu.org; Tue, 10 Aug 2021 20:35:07 -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=1628642100; 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=lWw3jSE2qpRMgcc0MG9K6uKLN4id4Mhi3251RlOcBmg=; b=UVgNgWVlfhrteA6JfuKXkoDze5Z3uzXIbV+EOo4QDxZ0dpCKPlXSE6N6lKfQzibLVizRym ssAIvWDnEnqHrP2eLUEfmxIbG0RfW8aYa34ylVZD6SeIHMISYmbwZl+wJRamtL+fKid85Y yxK+2JQ91B5RVBBLt7gNwUgbRvmciumUwN3Y/iNtaUe9DlpgMTUNpdtg//EisHCbs5A2Ka lA+wUaT3JL0ZrIHxG1ZzPMXY4+nWI5CNmy3pSOFp32Xo5i4kEeWH38LAdTkyrYyQceBqqp pU6UG3pKQzHR+mGzRrzTnebjmOILmBaW71aKjQecVeqGEploG/5TaYTl1S0hgQ== From: Kyle Meyer In-Reply-To: <87r1f1sp2x.fsf@gnu.org> 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> <87r1f1sp2x.fsf@gnu.org> Date: Tue, 10 Aug 2021 20:34:58 -0400 Message-ID: <87czqkizt9.fsf@kyleam.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: kyle@kyleam.com X-Spam-Score: -0.7 (/) 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: -1.7 (-) Ludovic Court=C3=A8s writes: > 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? Yep, for the default branch $NAME, "ref: refs/remotes/origin/$NAME\n" can be written to .git/refs/origin/HEAD. With respect to getting the default branch, I said in my last message that I thought it'd be possible to glean the target from the remote-ls output. To flesh that out a bit: --8<---------------cut here---------------start------------->8--- (use-modules (git) (system foreign)) (define origin (remote-lookup (repository-open ".") "origin")) (remote-connect origin) (define head (car (remote-ls origin))) (define target-pt (make-pointer ((record-accessor (record-type-descriptor head) 'symref-target) head))) (if (not (null-pointer? target-pt)) (display (pointer->string target-pt))) ;; =3D> refs/heads/master --8<---------------cut here---------------end--------------->8--- And that looks like it matches what libgit2's git_remote_default_branch() does for the non-guessing case (see below), so stopping there may be sufficient for a compatibility kludge. --8<---------------cut here---------------start------------->8--- if ((error =3D git_remote_ls(&heads, &heads_len, remote)) < 0) goto done; if (heads_len =3D=3D 0 || strcmp(heads[0]->name, GIT_HEAD_FILE)) { error =3D GIT_ENOTFOUND; goto done; } if ((error =3D git_buf_sanitize(out)) < 0) return error; /* the first one must be HEAD so if that has the symref info, we're done */ if (heads[0]->symref_target) { error =3D git_buf_puts(out, heads[0]->symref_target); goto done; } /* * If there's no symref information, we have to look over them * and guess. We return the first match unless the default * branch is a candidate. Then we return the default branch. */--8<---------------cut here---------------end--------------->8---