Message ID | 444e7e32d49b56ba6cb0a132e97d63560d8de437.1692281315.git.zimon.toutoune@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 B079B27BBE2; Thu, 17 Aug 2023 15:10:25 +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 B6D5C27BBEA for <patchwork@mira.cbaines.net>; Thu, 17 Aug 2023 15:10:24 +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 1qWdhT-00078g-Nh; Thu, 17 Aug 2023 10:10:11 -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 1qWdhP-00073E-3K for guix-patches@gnu.org; Thu, 17 Aug 2023 10:10:07 -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 1qWdhL-0006Yz-31 for guix-patches@gnu.org; Thu, 17 Aug 2023 10:10:06 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1qWdhK-0007cC-Uj for guix-patches@gnu.org; Thu, 17 Aug 2023 10:10:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#65352] [PATCH 2/2] scripts: pull: Remove unused reference pair. Resent-From: Simon Tournier <zimon.toutoune@gmail.com> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org> Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 17 Aug 2023 14:10:02 +0000 Resent-Message-ID: <handler.65352.B65352.169228136829210@debbugs.gnu.org> Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 65352 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 65352@debbugs.gnu.org Cc: Simon Tournier <zimon.toutoune@gmail.com> Received: via spool by 65352-submit@debbugs.gnu.org id=B65352.169228136829210 (code B ref 65352); Thu, 17 Aug 2023 14:10:02 +0000 Received: (at 65352) by debbugs.gnu.org; 17 Aug 2023 14:09:28 +0000 Received: from localhost ([127.0.0.1]:45278 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>) id 1qWdgl-0007az-Rt for submit@debbugs.gnu.org; Thu, 17 Aug 2023 10:09:28 -0400 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]:40297) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <zimon.toutoune@gmail.com>) id 1qWdgj-0007ae-Np for 65352@debbugs.gnu.org; Thu, 17 Aug 2023 10:09:26 -0400 Received: by mail-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-3fe8d816a40so12946855e9.1 for <65352@debbugs.gnu.org>; Thu, 17 Aug 2023 07:09:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692281360; x=1692886160; 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=ZVcZTXujkU3RxQdcdytnK4naEHEw6fQAf3sEJF0h7EI=; b=MACIhuAs3NCnVTTO47WMT6DlMMU77YutPLuhWhx8tJIF05cAREzWXhlE+/K5ICpQTp pbUYCypmPmPIJUUa44R39Xuy9fzJtqvlPPml7HcfS1toNIRDXS2lZ0b9/lnWPEPHg8eN +gNeW/czpl7jP5S5NV6MRGr+w3adahmxhAWDpupUN6ornVpR798d745oNDvx9a+vwtrr gCS/OiTBIgn+A4bihgbglT2XkACbPOTKL0xOk0QP43m2c0uEonZV6/ekzl53QzLIFY0k rHDWBfbW4RQLTey8IRci0oDr2KyrM6wlnHdaiHbGZG+UDIiE6oRi72rVcS4wqrKyExYn swmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692281360; x=1692886160; 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=ZVcZTXujkU3RxQdcdytnK4naEHEw6fQAf3sEJF0h7EI=; b=QSBZTkOsag2fWWvgRpF242tUgYnWf2igs7tWppLfCWbCKHMUsDVKswyRkicZGL0lLq 58Dth2ICQz0nvZaSwRnE3lXwr+XbxtK14Gw0DXEsVRtQcIwgC7jOnAfxGkfu8b9EZ8/c oNYRa2wXxxG7cSHBGZh5LuhgxoxGxSfRQ752RBF8xIuUVmtU03tO3ltv8LLVuBxHbjCZ rVGAjipeASjqGH6UMHNCaoOqBKrIWhsT+06vTKIkw8oNYiRu5Ti2PwIYfjNbtQy7/l/q 9Qm92fTTbdTyh7S9Ws6lcKcCpfWoTElTEd8xuMqSu7yuDhsnNW8oxD77Ozs2czydKoNZ fLkA== X-Gm-Message-State: AOJu0YxA/SQfwJtaRWVOB7n7QBq4n4alNP1O/pvzPyhWtmzRR1krvjCQ 5T9EE+bojVk8o3C/lyiUhAylqIpujsM= X-Google-Smtp-Source: AGHT+IElCHrs38hHzRPrnlOE1qEViDK9it7nEEhbK9pplo/UxZgqEWH4/e4R1x6dMBx+nitNJ+wj+w== X-Received: by 2002:a5d:444f:0:b0:317:5f08:329f with SMTP id x15-20020a5d444f000000b003175f08329fmr4244170wrr.1.1692281359875; Thu, 17 Aug 2023 07:09:19 -0700 (PDT) Received: from localhost.localdomain ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id 10-20020a05600c228a00b003fe4ca8decdsm3135502wmf.31.2023.08.17.07.09.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 17 Aug 2023 07:09:19 -0700 (PDT) From: Simon Tournier <zimon.toutoune@gmail.com> Date: Thu, 17 Aug 2023 16:09:17 +0200 Message-Id: <444e7e32d49b56ba6cb0a132e97d63560d8de437.1692281315.git.zimon.toutoune@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <c5156f9a756c2a6a304dc789c00abf533c787fd8.1692281315.git.zimon.toutoune@gmail.com> References: <c5156f9a756c2a6a304dc789c00abf533c787fd8.1692281315.git.zimon.toutoune@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 |
[bug#65352,1/2] guix: git: Fix the procedure reference-available?.
|
|
Commit Message
Simon Tournier
Aug. 17, 2023, 2:09 p.m. UTC
* guix/scripts/pull.scm (channel-list): Remove commit pair reference specification. --- guix/scripts/pull.scm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
Comments
Hi Simon, Simon Tournier <zimon.toutoune@gmail.com> writes: > * guix/scripts/pull.scm (channel-list): Remove commit pair reference > specification. > --- > guix/scripts/pull.scm | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm > index 9b78d4b5ca..616926ee0b 100644 > --- a/guix/scripts/pull.scm > +++ b/guix/scripts/pull.scm > @@ -774,8 +774,7 @@ (define (channel-list opts) > (if (guix-channel? c) > (let ((url (or url (channel-url c)))) > (match ref > - ((or ('commit . commit) > - ('tag-or-commit . commit)) > + (('tag-or-commit . commit) > (channel (inherit c) > (url url) (commit commit) (branch #f))) > (('branch . branch) Not that channel-list is a public API, so this is effectively changing the contract, no? Otherwise, the series LGTM, thank you!
Hi Maxim, On Thu, 17 Aug 2023 at 17:42, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote: > > (match ref > > - ((or ('commit . commit) > > - ('tag-or-commit . commit)) > > + (('tag-or-commit . commit) > Not that channel-list is a public API, so this is effectively changing > the contract, no? Well, the contract is not clearly defined. ;-) The REF is defined by the docstring of update-cached-checkout, REF is pair whose key is [branch | commit | tag | tag-or-commit ] and value the associated data: [<branch name> | <sha1> | <tag name> | <string>]. If REF is the empty list, the remote HEAD is used. Therefore, if we want to be compliant with the public API, we also need to add 'tag' to the 'or' match case; as I suggested when commenting your patch tweaking this part. :-) Well, from my point of view, the alternative is: a) (match ref (('tag-or-commit . commit) (channel (inherit c) (url url) (commit commit) (branch #f))) (('branch . branch) (channel (inherit c) (url url) (commit #f) (branch branch))) (#f (channel (inherit c) (url url)))) or b) (match ref ((or ('commit . commit) ('tag-or-commit . commit) ('tag . commit)) (channel (inherit c) (url url) (commit commit) (branch #f))) (('branch . branch) (channel (inherit c) (url url) (commit #f) (branch branch))) (#f (channel (inherit c) (url url))))) but not ecab937897385fce3e3ce0c5f128afba4304187c. :-) Cheers, simon
Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis: > Simon Tournier <zimon.toutoune@gmail.com> writes: > >> * guix/scripts/pull.scm (channel-list): Remove commit pair reference >> specification. >> --- >> guix/scripts/pull.scm | 3 +-- >> 1 file changed, 1 insertion(+), 2 deletions(-) >> >> diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm >> index 9b78d4b5ca..616926ee0b 100644 >> --- a/guix/scripts/pull.scm >> +++ b/guix/scripts/pull.scm >> @@ -774,8 +774,7 @@ (define (channel-list opts) >> (if (guix-channel? c) >> (let ((url (or url (channel-url c)))) >> (match ref >> - ((or ('commit . commit) >> - ('tag-or-commit . commit)) >> + (('tag-or-commit . commit) >> (channel (inherit c) >> (url url) (commit commit) (branch #f))) >> (('branch . branch) > > Not that channel-list is a public API, so this is effectively changing > the contract, no? Yes, but it’s really meant to be used internally, where it’s either 'tag-or-commit or 'branch in practice. So to me either way is fine. Thanks, Ludo’.
Hi, Ludovic Courtès <ludo@gnu.org> writes: > Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis: > >> Simon Tournier <zimon.toutoune@gmail.com> writes: >> >>> * guix/scripts/pull.scm (channel-list): Remove commit pair reference >>> specification. >>> --- >>> guix/scripts/pull.scm | 3 +-- >>> 1 file changed, 1 insertion(+), 2 deletions(-) >>> >>> diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm >>> index 9b78d4b5ca..616926ee0b 100644 >>> --- a/guix/scripts/pull.scm >>> +++ b/guix/scripts/pull.scm >>> @@ -774,8 +774,7 @@ (define (channel-list opts) >>> (if (guix-channel? c) >>> (let ((url (or url (channel-url c)))) >>> (match ref >>> - ((or ('commit . commit) >>> - ('tag-or-commit . commit)) >>> + (('tag-or-commit . commit) >>> (channel (inherit c) >>> (url url) (commit commit) (branch #f))) >>> (('branch . branch) >> >> Not that channel-list is a public API, so this is effectively changing >> the contract, no? > > Yes, but it’s really meant to be used internally, where it’s either > 'tag-or-commit or 'branch in practice. So to me either way is fine. In this case, should we stop exporting it from the module? (and use it via the (@ (...)) trick as needed). This would communicate the intention best.
Hi, Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis: > Ludovic Courtès <ludo@gnu.org> writes: [...] >>> Not that channel-list is a public API, so this is effectively changing >>> the contract, no? >> >> Yes, but it’s really meant to be used internally, where it’s either >> 'tag-or-commit or 'branch in practice. So to me either way is fine. > > In this case, should we stop exporting it from the module? (and use it > via the (@ (...)) trick as needed). This would communicate the > intention best. Well, there are different levels of “internal” I guess. :-) @@ (double-at) should only be used as a last resort; whether it’s usable at all depends on inlining decisions made by the compiler. So in this case, I’m for plain #:export. Thanks, Ludo’.
Hi, Ludovic Courtès <ludo@gnu.org> writes: > Hi, > > Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis: > >> Ludovic Courtès <ludo@gnu.org> writes: > > [...] > >>>> Not that channel-list is a public API, so this is effectively changing >>>> the contract, no? >>> >>> Yes, but it’s really meant to be used internally, where it’s either >>> 'tag-or-commit or 'branch in practice. So to me either way is fine. >> >> In this case, should we stop exporting it from the module? (and use it >> via the (@ (...)) trick as needed). This would communicate the >> intention best. > > Well, there are different levels of “internal” I guess. :-) > > @@ (double-at) should only be used as a last resort; whether it’s usable > at all depends on inlining decisions made by the compiler. So in this > case, I’m for plain #:export. OK! Yes, whatever suites the bill best :-).
Hi Simon, Simon Tournier <zimon.toutoune@gmail.com> writes: > Hi Maxim, > > On Thu, 17 Aug 2023 at 17:42, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote: > >> > (match ref >> > - ((or ('commit . commit) >> > - ('tag-or-commit . commit)) >> > + (('tag-or-commit . commit) > >> Not that channel-list is a public API, so this is effectively changing >> the contract, no? > > Well, the contract is not clearly defined. ;-) > > The REF is defined by the docstring of update-cached-checkout, > > REF is pair whose key is [branch | commit | tag | tag-or-commit ] and value > the associated data: [<branch name> | <sha1> | <tag name> | <string>]. > If REF is the empty list, the remote HEAD is used. Good catch, it seems tag is not covered. > Therefore, if we want to be compliant with the public API, we also > need to add 'tag' to the 'or' match case; as I suggested when > commenting your patch tweaking this part. :-) > > Well, from my point of view, the alternative is: > > a) > (match ref > (('tag-or-commit . commit) > (channel (inherit c) > (url url) (commit commit) (branch #f))) > (('branch . branch) > (channel (inherit c) > (url url) (commit #f) (branch branch))) > (#f > (channel (inherit c) (url url)))) > > or b) > (match ref > ((or ('commit . commit) > ('tag-or-commit . commit) > ('tag . commit)) > (channel (inherit c) > (url url) (commit commit) (branch #f))) > (('branch . branch) > (channel (inherit c) > (url url) (commit #f) (branch branch))) > (#f > (channel (inherit c) (url url))))) > > but not ecab937897385fce3e3ce0c5f128afba4304187c. :-) I was driven by my use case where adding support for tag-or-commit was enough, but I think it'd be a good idea to cover all the potential ref types documented in update-cached-checkout, so b) makes sense to me.
Hi Maxim, On Tue, 22 Aug 2023 at 22:56, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote: >> or b) >> (match ref >> ((or ('commit . commit) >> ('tag-or-commit . commit) >> ('tag . commit)) >> (channel (inherit c) >> (url url) (commit commit) (branch #f))) >> (('branch . branch) >> (channel (inherit c) >> (url url) (commit #f) (branch branch))) >> (#f >> (channel (inherit c) (url url))))) >> >> but not ecab937897385fce3e3ce0c5f128afba4304187c. :-) > > I was driven by my use case where adding support for tag-or-commit was > enough, but I think it'd be a good idea to cover all the potential ref > types documented in update-cached-checkout, so b) makes sense to me. Ok, b) is fine with me. Sorry for not being clear in #64746 but this consistency was the subject of my comment [1]. :-) Cheers, simon 1: https://issues.guix.gnu.org/64746#13
Hi Simon, Simon Tournier <zimon.toutoune@gmail.com> writes: > Hi Maxim, > > On Tue, 22 Aug 2023 at 22:56, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote: > >>> or b) >>> (match ref >>> ((or ('commit . commit) >>> ('tag-or-commit . commit) >>> ('tag . commit)) >>> (channel (inherit c) >>> (url url) (commit commit) (branch #f))) >>> (('branch . branch) >>> (channel (inherit c) >>> (url url) (commit #f) (branch branch))) >>> (#f >>> (channel (inherit c) (url url))))) >>> >>> but not ecab937897385fce3e3ce0c5f128afba4304187c. :-) >> >> I was driven by my use case where adding support for tag-or-commit was >> enough, but I think it'd be a good idea to cover all the potential ref >> types documented in update-cached-checkout, so b) makes sense to me. > > Ok, b) is fine with me. > > Sorry for not being clear in #64746 but this consistency was the subject > of my comment [1]. :-) I'm glad we finally came to a common understanding, ah!
diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm index 9b78d4b5ca..616926ee0b 100644 --- a/guix/scripts/pull.scm +++ b/guix/scripts/pull.scm @@ -774,8 +774,7 @@ (define (channel-list opts) (if (guix-channel? c) (let ((url (or url (channel-url c)))) (match ref - ((or ('commit . commit) - ('tag-or-commit . commit)) + (('tag-or-commit . commit) (channel (inherit c) (url url) (commit commit) (branch #f))) (('branch . branch)