Message ID | a76e62f54c649713083ff3e51442c49f66857b22.1692128648.git.maxim.cournoyer@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org> X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 155C927BBEA; Tue, 15 Aug 2023 20:46:37 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FROM,MAILING_LIST_MULTI, SPF_HELO_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 82B8427BBE9 for <patchwork@mira.cbaines.net>; Tue, 15 Aug 2023 20:46:36 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <guix-patches-bounces@gnu.org>) id 1qVzzV-0002R5-QT; Tue, 15 Aug 2023 15:46:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1qVzzQ-0002Pw-Gz for guix-patches@gnu.org; Tue, 15 Aug 2023 15:46:05 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1qVzzP-0007Wr-FK; Tue, 15 Aug 2023 15:46:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1qVzzN-0001mJ-VL; Tue, 15 Aug 2023 15:46:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#64746] [PATCH v2 2/3] pull: Tag commit argument with 'tag-or-commit. Resent-From: Maxim Cournoyer <maxim.cournoyer@gmail.com> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org> Resent-CC: guix@cbaines.net, dev@jpoiret.xyz, ludo@gnu.org, othacehe@gnu.org, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, guix-patches@gnu.org Resent-Date: Tue, 15 Aug 2023 19:46:01 +0000 Resent-Message-ID: <handler.64746.B64746.16921287156766@debbugs.gnu.org> Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64746 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 64746@debbugs.gnu.org Cc: Maxim Cournoyer <maxim.cournoyer@gmail.com>, Christopher Baines <guix@cbaines.net>, Josselin Poiret <dev@jpoiret.xyz>, Ludovic =?utf-8?q?Court=C3=A8s?= <ludo@gnu.org>, Mathieu Othacehe <othacehe@gnu.org>, Ricardo Wurmus <rekado@elephly.net>, Simon Tournier <zimon.toutoune@gmail.com>, Tobias Geerinckx-Rice <me@tobias.gr> X-Debbugs-Original-Xcc: Christopher Baines <guix@cbaines.net>, Josselin Poiret <dev@jpoiret.xyz>, Ludovic =?utf-8?q?Court=C3=A8s?= <ludo@gnu.org>, Mathieu Othacehe <othacehe@gnu.org>, Ricardo Wurmus <rekado@elephly.net>, Simon Tournier <zimon.toutoune@gmail.com>, Tobias Geerinckx-Rice <me@tobias.gr> Received: via spool by 64746-submit@debbugs.gnu.org id=B64746.16921287156766 (code B ref 64746); Tue, 15 Aug 2023 19:46:01 +0000 Received: (at 64746) by debbugs.gnu.org; 15 Aug 2023 19:45:15 +0000 Received: from localhost ([127.0.0.1]:36663 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>) id 1qVzyc-0001l2-RB for submit@debbugs.gnu.org; Tue, 15 Aug 2023 15:45:15 -0400 Received: from mail-qt1-x82d.google.com ([2607:f8b0:4864:20::82d]:53425) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <maxim.cournoyer@gmail.com>) id 1qVzyX-0001kT-Vh for 64746@debbugs.gnu.org; Tue, 15 Aug 2023 15:45:11 -0400 Received: by mail-qt1-x82d.google.com with SMTP id d75a77b69052e-403e7472b28so34775011cf.2 for <64746@debbugs.gnu.org>; Tue, 15 Aug 2023 12:45:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692128704; x=1692733504; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=B8hGdU4OELa28DbMUXTnepI6us/G3Bq8sQl7rzDGixY=; b=LSfcwxejybTLHs3fO+eVtO8eAVQzOvW40TX3Yon/fwzETpzDBJdvha3jLfa8FYwopB KLtj40AUexXNz6g4H/udVKqNqoxtC/IVxEzQK8tzKadJuZu5uhhuGBOUYmgubsnEHBP4 q/o++gL2E32t3zaj1KHrqlOqA0Px7J3+NXI7kLKJhpu7aI67nOgmWi3Y72FcB+BHFnpd 6lv2LUvQ2xDVVKiefeyfkqUzI/XCmoqAq1Y/TbIMlmygqgoQ8/kgqwvZ9RxOjK6YdxKy I8Si4oqY5gg1VKSZjqe9ptvchLd4/dwi/rnQr4+U3l0yI9DH8VQbnmMTj9V5CyAnJZb9 iyrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692128704; x=1692733504; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=B8hGdU4OELa28DbMUXTnepI6us/G3Bq8sQl7rzDGixY=; b=Vu6yuXY2NXwN+B9dX20BHgJQOdoZqhxTTTzXc9lIyVpG4dwS+pIXV1wwXZq3U+RmqK Mv5PFE+x17v2xjMhLQl25U+HqMpOhrC9ta/I0rsLPiQs5g70u7dQL3/Rgvtkje+fyAAB QAqHp3+loSaqhm1w7zMvuNoK56x/+Pna6dy84BFm5bDoaBHVyjke5jLKt3InvC0afROA TmUx+qtvR0UwlQaH4v1XcT1nI/tQFthcR6AmpP1AmkW7EJXoP2OH8gpLQVmmcn1IlSTM Ju79nRlvGtg8lMpjJ/E7j+ISiN1nZcD/niZhtGAq8Veoj/WjGxBlfpRNV5StDSe8f7za zBkQ== X-Gm-Message-State: AOJu0YyHUEjrY9JlF7OM1WH2bq/LaxnmnefE7ylqUCf4bH4hxbNFq14Z zhIdpM2AMtPJia0gXTO8AA834Vn5hEScUQ== X-Google-Smtp-Source: AGHT+IH9hSgIttU+hjCcnp32bBE9BaF0+xKwekR4glL+epVaPXiH1FHFpieUpKIjBhE/YJDmuSj21w== X-Received: by 2002:a05:622a:1482:b0:40f:ecef:cab3 with SMTP id t2-20020a05622a148200b0040fecefcab3mr17560126qtx.33.1692128704313; Tue, 15 Aug 2023 12:45:04 -0700 (PDT) Received: from localhost.localdomain (dsl-148-65.b2b2c.ca. [66.158.148.65]) by smtp.gmail.com with ESMTPSA id h11-20020ac8744b000000b00403ad6ec2e8sm3953031qtr.26.2023.08.15.12.45.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Aug 2023 12:45:03 -0700 (PDT) From: Maxim Cournoyer <maxim.cournoyer@gmail.com> Date: Tue, 15 Aug 2023 15:44:08 -0400 Message-ID: <a76e62f54c649713083ff3e51442c49f66857b22.1692128648.git.maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <340786ccd3d40c0c8906028dc20af5ae9b0aa6b9.1692128648.git.maxim.cournoyer@gmail.com> References: <340786ccd3d40c0c8906028dc20af5ae9b0aa6b9.1692128648.git.maxim.cournoyer@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: <guix-patches.gnu.org> List-Unsubscribe: <https://lists.gnu.org/mailman/options/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=unsubscribe> List-Archive: <https://lists.gnu.org/archive/html/guix-patches> List-Post: <mailto:guix-patches@gnu.org> List-Help: <mailto:guix-patches-request@gnu.org?subject=help> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=subscribe> Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches |
Series |
None
|
|
Commit Message
Maxim Cournoyer
Aug. 15, 2023, 7:44 p.m. UTC
For compatibility with (guix git) procedures. * guix/scripts/pull.scm (channel-list): Also accept tag-or-commit tagged refspec. --- New commit. guix/scripts/pull.scm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
Comments
Hi Maxim, On Tue, 15 Aug 2023 at 15:44, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote: > For compatibility with (guix git) procedures. > > * guix/scripts/pull.scm (channel-list): Also accept tag-or-commit tagged > refspec. > --- I am not sure to understand these both changes. > > guix/scripts/pull.scm | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm > index ecd264d3fa..9b78d4b5ca 100644 > --- a/guix/scripts/pull.scm > +++ b/guix/scripts/pull.scm > @@ -166,7 +166,7 @@ (define %options > (alist-delete 'repository-url result)))) > (option '("commit") #t #f > (lambda (opt name arg result) > - (alist-cons 'ref `(commit . ,arg) result))) > + (alist-cons 'ref `(tag-or-commit . ,arg) result))) Well, why not. :-) > (option '("branch") #t #f > (lambda (opt name arg result) > (alist-cons 'ref `(branch . ,arg) result))) > @@ -774,7 +774,8 @@ (define (channel-list opts) > (if (guix-channel? c) > (let ((url (or url (channel-url c)))) > (match ref > - (('commit . commit) > + ((or ('commit . commit) > + ('tag-or-commit . commit)) Here, why not also add 'tag?. Hum, I am missing why this ’tag-or-commit would be required. Cheers, simon
Hi Simon, Simon Tournier <zimon.toutoune@gmail.com> writes: > Hi Maxim, > > On Tue, 15 Aug 2023 at 15:44, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote: >> For compatibility with (guix git) procedures. >> >> * guix/scripts/pull.scm (channel-list): Also accept tag-or-commit tagged >> refspec. >> --- > > I am not sure to understand these both changes. > >> >> guix/scripts/pull.scm | 5 +++-- >> 1 file changed, 3 insertions(+), 2 deletions(-) >> >> diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm >> index ecd264d3fa..9b78d4b5ca 100644 >> --- a/guix/scripts/pull.scm >> +++ b/guix/scripts/pull.scm >> @@ -166,7 +166,7 @@ (define %options >> (alist-delete 'repository-url result)))) >> (option '("commit") #t #f >> (lambda (opt name arg result) >> - (alist-cons 'ref `(commit . ,arg) result))) >> + (alist-cons 'ref `(tag-or-commit . ,arg) result))) > > Well, why not. :-) The reason is to standardize the API of (guix pull) and (guix git), whose procedure had a different expectation for 'ref' objects.
Hi Maxim, On Wed, 16 Aug 2023 at 14:47, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote: >>> (option '("commit") #t #f >>> (lambda (opt name arg result) >>> - (alist-cons 'ref `(commit . ,arg) result))) >>> + (alist-cons 'ref `(tag-or-commit . ,arg) result))) [...] > (match ref > - (('commit . commit) > + ((or ('commit . commit) > + ('tag-or-commit . commit)) > The reason is to standardize the API of (guix pull) and (guix git), > whose procedure had a different expectation for 'ref' objects. My point is that this ’or’ is useless, IIUC. Well, I have removed it in the series fixing the annoyance with the network access of “guix time-machine”. Cheers, simon
Hi Simon, Simon Tournier <zimon.toutoune@gmail.com> writes: > Hi Maxim, > > On Wed, 16 Aug 2023 at 14:47, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote: > >>>> (option '("commit") #t #f >>>> (lambda (opt name arg result) >>>> - (alist-cons 'ref `(commit . ,arg) result))) >>>> + (alist-cons 'ref `(tag-or-commit . ,arg) result))) > > [...] > >> (match ref >> - (('commit . commit) >> + ((or ('commit . commit) >> + ('tag-or-commit . commit)) > >> The reason is to standardize the API of (guix pull) and (guix git), >> whose procedure had a different expectation for 'ref' objects. > > My point is that this ’or’ is useless, IIUC. Well, I have removed it in > the series fixing the annoyance with the network access of “guix > time-machine”. It isn't, unless you meant after applying further changes :-) You should be able to see the problem by reverting that commit and running 'guix time-machine --commit=v1.4.0 -- describe', for example.
Re Maxim, On Thu, 17 Aug 2023 at 20:16, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote: > > On Wed, 16 Aug 2023 at 14:47, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote: > > > >>>> (option '("commit") #t #f > >>>> (lambda (opt name arg result) > >>>> - (alist-cons 'ref `(commit . ,arg) result))) > >>>> + (alist-cons 'ref `(tag-or-commit . ,arg) result))) > > > > [...] > > > >> (match ref > >> - (('commit . commit) > >> + ((or ('commit . commit) > >> + ('tag-or-commit . commit)) > > > >> The reason is to standardize the API of (guix pull) and (guix git), > >> whose procedure had a different expectation for 'ref' objects. > > > > My point is that this ’or’ is useless, IIUC. Well, I have removed it in > > the series fixing the annoyance with the network access of “guix > > time-machine”. > > It isn't, unless you meant after applying further changes :-) You should > be able to see the problem by reverting that commit and running 'guix > time-machine --commit=v1.4.0 -- describe', for example. Yes for sure because you introduced this in guix/scripts/time-machine.scm, (lambda (opt name arg result) - (alist-cons 'ref `(commit . ,arg) result))) + (alist-cons 'ref `(tag-or-commit . ,arg) result))) with the previous commit 79ec651a286c71a3d4c72be33a1f80e76a560031. Well, I feel there is a misunderstanding. :-) And maybe I am missing something... IIUC, the option parser: (option '("commit") #t #f (lambda (opt name arg result) (alist-cons 'ref `(commit . ,arg) result))) implemented in guix/scrtips/pull.scm provides a way to construct this REF. This way should be compliant with the other one in guix/scripts/time-machine.scm -- at least for being consistent. And I am missing the reason why you introduced this difference. If the both option parsers use the same way, then the 'or' is useless. As I said initially commenting this patch v2 2/3: --8<---------------cut here---------------start------------->8--- > For compatibility with (guix git) procedures. > > * guix/scripts/pull.scm (channel-list): Also accept tag-or-commit tagged > refspec. > --- I am not sure to understand these both changes. --8<---------------cut here---------------end--------------->8--- Anyway, my other message [1] in #65352 contains the two alternatives for closing this discussion. :-) 1: https://issues.guix.gnu.org/65352#4 Cheers, simon
Hi again, Simon Tournier <zimon.toutoune@gmail.com> writes: > Re Maxim, > > On Thu, 17 Aug 2023 at 20:16, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote: > >> > On Wed, 16 Aug 2023 at 14:47, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote: >> > >> >>>> (option '("commit") #t #f >> >>>> (lambda (opt name arg result) >> >>>> - (alist-cons 'ref `(commit . ,arg) result))) >> >>>> + (alist-cons 'ref `(tag-or-commit . ,arg) result))) >> > >> > [...] >> > >> >> (match ref >> >> - (('commit . commit) >> >> + ((or ('commit . commit) >> >> + ('tag-or-commit . commit)) >> > >> >> The reason is to standardize the API of (guix pull) and (guix git), >> >> whose procedure had a different expectation for 'ref' objects. >> > >> > My point is that this ’or’ is useless, IIUC. Well, I have removed it in >> > the series fixing the annoyance with the network access of “guix >> > time-machine”. >> >> It isn't, unless you meant after applying further changes :-) You should >> be able to see the problem by reverting that commit and running 'guix >> time-machine --commit=v1.4.0 -- describe', for example. > > Yes for sure because you introduced this in guix/scripts/time-machine.scm, > > (lambda (opt name arg result) > - (alist-cons 'ref `(commit . ,arg) result))) > + (alist-cons 'ref `(tag-or-commit . ,arg) result))) > > with the previous commit 79ec651a286c71a3d4c72be33a1f80e76a560031. It's a bit convoluted, but there are three things involved: 1. (guix scripts time-machine) 2. (guix pull) 3. (guix git) They are involved in that order, if I remember correctly. Now the important part is that the update-cached-checkout from (guix git), newly used in (guix scripts time-machine), should be passed a tag-or-commit ref and not a commit one if we want to support both tags or commits (otherwise tags would throw an error about not respecting a git hash format). Since 'guix time-machine --commit' is documented as accepting a tag or commit, it makes sense to tag it as such at that point. I hope this clarifies it?
Hi Maxim, On Tue, 22 Aug 2023 at 22:54, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote: > 1. (guix scripts time-machine) > 2. (guix pull) > 3. (guix git) [...] > I hope this clarifies it? All is clear since my initial comment [1] about this patch. ;-) And my proposal for improving the asymmetry your patch introduced is summarized by the alternative options I wrote in [2]. Therefore, I will continue the discussion in #65352. :-) 1: https://issues.guix.gnu.org/64746#13 2: https://issues.guix.gnu.org/65352#4 Cheers, simon
diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm index ecd264d3fa..9b78d4b5ca 100644 --- a/guix/scripts/pull.scm +++ b/guix/scripts/pull.scm @@ -166,7 +166,7 @@ (define %options (alist-delete 'repository-url result)))) (option '("commit") #t #f (lambda (opt name arg result) - (alist-cons 'ref `(commit . ,arg) result))) + (alist-cons 'ref `(tag-or-commit . ,arg) result))) (option '("branch") #t #f (lambda (opt name arg result) (alist-cons 'ref `(branch . ,arg) result))) @@ -774,7 +774,8 @@ (define (channel-list opts) (if (guix-channel? c) (let ((url (or url (channel-url c)))) (match ref - (('commit . commit) + ((or ('commit . commit) + ('tag-or-commit . commit)) (channel (inherit c) (url url) (commit commit) (branch #f))) (('branch . branch)