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 wPYTA2LH2WBcFQAAgWs5BA (envelope-from ) for ; Mon, 28 Jun 2021 14:58:10 +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 WMpmOmHH2WDeOwAA1q6Kng (envelope-from ) for ; Mon, 28 Jun 2021 12:58:09 +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 B2E1E152AB for ; Mon, 28 Jun 2021 14:58:09 +0200 (CEST) Received: from localhost ([::1]:49244 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lxqq0-00021B-QH for larch@yhetil.org; Mon, 28 Jun 2021 08:58:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34378) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lxqox-00017x-Rd for guix-patches@gnu.org; Mon, 28 Jun 2021 08:57:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39715) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lxqow-0003OU-Qn for guix-patches@gnu.org; Mon, 28 Jun 2021 08:57:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lxqow-0006KY-59; Mon, 28 Jun 2021 08:57: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: 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-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=1624885089; 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:resent-cc:resent-from:resent-sender: resent-message-id:list-id:list-help:list-unsubscribe:list-subscribe: list-post; bh=05T90th6d9Dm/Q57Zgq5OfYECsTONDrZlTuWSq6lOlY=; b=NLjDc8cOysM697m9CTUveK2hV5ghLKTEwzx6a+IcvMWcn78pHWlZuLjipRiFL1rtLVxGfa tEmFoXgDxc8tqpn7H8LjDEu890LQ5o0mWk76KUR8v2u8Vl7QEcL88cxNPVIXL7eiqOYcCQ +pYfVpMN0PIWViHZGW3HS/8De+7NlQvE27Fj5iV1hhamuNQXvMefdxqTDo4OZMtoSA2ij2 xMV9m4lNv4vy+7Aar3KChqmiITZ1s4xbTGTKCZScKVtb9weRIdZVeI22pgMaY2OnmoCp2u PjJGLz6xMfrXSjCjWt8ZK98QQvZ8m5E55CMvLHVZfyeP9KiVI88Sb1/6N2fbaQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1624885089; a=rsa-sha256; cv=none; b=jGvUezLHqedMQCJTpA3Cz7E55Yx5Fb96nmQyu3/VWGBgBeA1ZEJjb5GcjSa5HgKLn7W933 oCQ7+6pwRe9PeA8Jb/6yJZG9rw3iCWc1KaxYVdVuKXYBw4jMVnsOcvvoinfcZfEg69uwHM Lrkt+svYYCrjhBXTniepZGA4l57lRUJ579EocCobdmg+WP+2q6ZNKCoS4W64clVb+qO+fW YWsPzWRFVUYnqDpKGsDdI/u9gmqJL2c8gdIRR+HntyoIGSL8Eke49cK0TLAZYcWME336e/ SQmAivkcsjD6Z8LEGdXO89bo5axr5VNTlbPN9aHeTV9TqZsQe9YBQvnDsfM/vQ== 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.92 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: B2E1E152AB X-Spam-Score: -2.92 X-Migadu-Scanner: scn1.migadu.com X-TUID: WIfH6i+qYPfm --=-=-= 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. --=-=-=--