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 EJshGoOCNmHqJgEAgWs5BA (envelope-from ) for ; Mon, 06 Sep 2021 23:05:07 +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 4LS5FYOCNmGfEQAA1q6Kng (envelope-from ) for ; Mon, 06 Sep 2021 21:05:07 +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 D615320333 for ; Mon, 6 Sep 2021 23:05:06 +0200 (CEST) Received: from localhost ([::1]:55648 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNLne-0002W5-1V for larch@yhetil.org; Mon, 06 Sep 2021 17:05:06 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34256) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNLna-0002Vw-Fd for guix-patches@gnu.org; Mon, 06 Sep 2021 17:05:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:43058) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mNLna-00065Y-7o for guix-patches@gnu.org; Mon, 06 Sep 2021 17:05:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mNLna-00077B-2z for guix-patches@gnu.org; Mon, 06 Sep 2021 17:05:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#50377] [PATCH 0/2] Support 'git describe' style commit IDs in transformations Resent-From: Ludovic =?UTF-8?Q?Court=C3=A8s?= Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 06 Sep 2021 21:05:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 50377 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Marius Bakke Cc: 50377@debbugs.gnu.org Received: via spool by 50377-submit@debbugs.gnu.org id=B50377.163096229627335 (code B ref 50377); Mon, 06 Sep 2021 21:05:02 +0000 Received: (at 50377) by debbugs.gnu.org; 6 Sep 2021 21:04:56 +0000 Received: from localhost ([127.0.0.1]:54604 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNLnU-00076o-8L for submit@debbugs.gnu.org; Mon, 06 Sep 2021 17:04:56 -0400 Received: from eggs.gnu.org ([209.51.188.92]:46390) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mNLnS-00076a-Rk for 50377@debbugs.gnu.org; Mon, 06 Sep 2021 17:04:55 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:53450) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mNLnN-0005xt-Ls for 50377@debbugs.gnu.org; Mon, 06 Sep 2021 17:04:49 -0400 Received: from [2a01:e0a:1d:7270:af76:b9b:ca24:c465] (port=35334 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mNLnN-0003Si-CR; Mon, 06 Sep 2021 17:04:49 -0400 From: Ludovic =?UTF-8?Q?Court=C3=A8s?= References: <20210906103846.14941-1-marius@gnu.org> <20210906103846.14941-3-marius@gnu.org> Date: Mon, 06 Sep 2021 23:04:47 +0200 In-Reply-To: <20210906103846.14941-3-marius@gnu.org> (Marius Bakke's message of "Mon, 6 Sep 2021 12:38:46 +0200") Message-ID: <87lf4976vk.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-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=1630962307; 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; bh=OiqM2/en8soUU9DbYPZPC/+8xR8wJKoBfZtcWTW105Y=; b=toNp/yMxmCYw+Xdr+U/myKaoFW0S7F08M1DcedD9RVdfHX7Ky0gxNC4N8ufQeknJxAkFp+ A/s6TstLgFtNPrR22rey6otCGkFM+6AxeOJ8chSHeKyTijSnz2JwKG9M0d+N/oIihdeO+H n6k2x/Z5k082ZH8rBQaviPwXOn1odyKLTXAA+PrZksycSEWp7rRSIAZbhTTtxP7wuhV414 45IU9tlxUCz7WcOqVgXMlkALiK3LouFrSmUB7W89rdGFrmeTOz3RPvCHR0pH7NtkuPM06S HS2fPnHRrdrQrx3PNkt/Rcm7pqjgVildLEhbm1GVJwWUTW3zFVg3xah7TDW7Cg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1630962307; a=rsa-sha256; cv=none; b=SIEJOL7EQruy0H/FaU1B8Ho2nt+y6DN1yKUPajYf8NWcikbcDMi3+R5B73SOdAfQrNiuSy grnxynb7PWru/ZLsQyLh19G+mEoUDDxaQz7U7YLYuBImqluAX1jtQjealopfZU3Y5VToqk YDeVMX4qynhfAguBgHwWkTPQRnzJHFrBcE/7e2KypofPWals8mXu/AbVUvrHlR9euCkYp9 XkVtcnOOkcaVW40hxJR9m7alwbY7gykbKhL3BFtuE69a3jBkaD5Kab0ejPMvTkjnzHLaeK sBKBqo1dSovpY7QnpCwNXAbJuLe9QNmXJOvKw30IkG4k3AHg1UxXWKQhwk55Rg== 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: D615320333 X-Spam-Score: -2.92 X-Migadu-Scanner: scn1.migadu.com X-TUID: zwgt5iLjFncn Marius Bakke skribis: > * guix/transformations.scm (transform-package-source-commit): Look for > 'git describe' style IDs and use it as the version if applicable. > * tests/transformations.scm > ("options->transformation, with-commit, 'git describe' style version"): N= ew > test. [...] > + (version (cond ((and (string-contains commit "-g") > + (match (string-split commit #\-) > + ((version ... revision g+commit) > + (and (> (string-length g+commit) 4) > + (string-every char-set:digit revision) > + (string-every char-set:hex-digit > + (string-drop g+commit 1= )))) > + (_ #f))) > + ;; This looks like a 'git describe' style ID. Drop > + ;; the 'v' prefix if applicable. > + (if (and (string-prefix? "v" commit) > + (char-set-contains? char-set:digit > + (string-take > + (string-drop commit = 1) > + 1))) > + (string-drop commit 1) > + commit)) > + ((and (> (string-length commit) 1) > + (string-prefix? "v" commit) > + (char-set-contains? char-set:digit > + (string-ref commit 1))) > + (string-drop commit 1)) ;looks like a tag li= ke "v1.0" > + (else > + (string-append "git." > + (if (< (string-length commit) 7) > + commit > + (string-take commit 7)))))) For clarity, I=E2=80=99d extract this as a =E2=80=98commit->version-string= =E2=80=99 procedure. Like Xinglu writes, it=E2=80=99d be great to add a sentence in the manual a= bout these IDs. Apart from that, it=E2=80=99s a good idea and it LGTM! Thanks, Ludo=E2=80=99.