From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id R/meIwLhOGGDKQEAgWs5BA (envelope-from ) for ; Wed, 08 Sep 2021 18:12:50 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id 2K04HgLhOGGGewAAbx9fmQ (envelope-from ) for ; Wed, 08 Sep 2021 16:12:50 +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 D57DF1B79E for ; Wed, 8 Sep 2021 18:12:49 +0200 (CEST) Received: from localhost ([::1]:42062 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mO0Bs-00074x-TR for larch@yhetil.org; Wed, 08 Sep 2021 12:12:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42628) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mO08E-0000ho-Us for guix-patches@gnu.org; Wed, 08 Sep 2021 12:09:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:50087) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mO08E-0004uo-MK for guix-patches@gnu.org; Wed, 08 Sep 2021 12:09:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mO08E-0002Ab-He for guix-patches@gnu.org; Wed, 08 Sep 2021 12:09:02 -0400 Subject: bug#50377: [PATCH 0/2] Support 'git describe' style commit IDs in transformations Resent-From: Marius Bakke Original-Sender: "Debbugs-submit" Resent-To: guix-patches@gnu.org Resent-Date: Wed, 08 Sep 2021 16:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 50377 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Cc: 50377-done@debbugs.gnu.org Mail-Followup-To: 50377@debbugs.gnu.org, marius@gnu.org, marius@gnu.org Received: via spool by 50377-done@debbugs.gnu.org id=D50377.16311173058217 (code D ref 50377); Wed, 08 Sep 2021 16:09:02 +0000 Received: (at 50377-done) by debbugs.gnu.org; 8 Sep 2021 16:08:25 +0000 Received: from localhost ([127.0.0.1]:33399 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mO07c-00028T-OT for submit@debbugs.gnu.org; Wed, 08 Sep 2021 12:08:24 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54580) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mO07b-00028E-Lu for 50377-done@debbugs.gnu.org; Wed, 08 Sep 2021 12:08:23 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:51860) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mO07W-0004QA-Ac; Wed, 08 Sep 2021 12:08:18 -0400 Received: from host-37-191-231-185.lynet.no ([37.191.231.185]:38052 helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mO07V-0001ql-6Y; Wed, 08 Sep 2021 12:08:17 -0400 From: Marius Bakke In-Reply-To: <87lf4976vk.fsf_-_@gnu.org> References: <20210906103846.14941-1-marius@gnu.org> <20210906103846.14941-3-marius@gnu.org> <87lf4976vk.fsf_-_@gnu.org> Date: Wed, 08 Sep 2021 18:08:14 +0200 Message-ID: <87lf476oep.fsf@gnu.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" 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=1631117570; 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-to: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=utGfOGVyhkR7VzC6Q4cEe9I5v15YqIDtVENPTLjnv+E=; b=sEtWwi8umOGKNrmkY66+Z8k/vVd+5kDVjoNoIjgoj0cWtzxzwFWWkm2V826J4LLQIVf72X ti7Q8f7BtbZcqdNqI42DC3XFAL8RTHaeQwQYGzhaH65bXEXgvcj56gMwA2bavjVIWBOLxq wHU1yrcPnR3X46SAZ4Kbk0K64v7byexThMg92nNNonnqKk1eiJMQl/zXp13cKmIMdJww61 2MDI9iW9Kos8hoQ7iA7HWi7VVwtfWfnZZNVyl8ouCncNn4lSlJb3rW8Vu7c3D6dNSfJxQG ptSBvwnpeCBycLv4B4B6qWK1yp7NbD34JssVJ5qMJb+bN1ziw5j8tbugL1vqfA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1631117570; a=rsa-sha256; cv=none; b=Ga4jfrxc6ACZ0dsV/vzYBJ9nLizTHK6gtXDdRT38O2pEWRcp4358AFPx64jyJrESxQJHAr d7zSJt8eo3R2aVxz6jsjrKnMOACdmaqqT2h3ZfHtzJDTQsnzVjS5nUBOUD1cZzMx5k6wLL tqrR4MFEQDzLo+1a6PnIdNpto/iwpR+T4rtIgiWbznBh8L0VjbkEjEwYGaT0TU9uU1M7YT 05B9bF3D1R4ZSeUS5AQu7dxgd5go9TbMcc49d9zhcjQ6yJTuHohuELWN0B3TH2iA3nFATc MTxqn2LfLv/sWKQTcOqcwQcGR1Pp2Rg8w0oFBxoYE++E6W08r0AaSmTs5DdMRw== 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: -5.01 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: D57DF1B79E X-Spam-Score: -5.01 X-Migadu-Scanner: scn1.migadu.com X-TUID: jUOLOUeyZD8W --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Ludovic Court=C3=A8s skriver: > Marius Bakke skribis: > >> + (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 revisio= n) >> + (string-every char-set:hex-digit >> + (string-drop g+commit = 1)))) >> + (_ #f))) >> + ;; This looks like a 'git describe' style ID. Dr= op >> + ;; 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 l= ike "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-strin= g=E2=80=99 procedure. > > Like Xinglu writes, it=E2=80=99d be great to add a sentence in the manual= about > these IDs. Thanks for the feedback! Looking at this again, I realized tags would not be used as version either which seemed like an oversight. So I fixed(?) that too and vastly simplified this patch. :-) Also adjusted the test to more thoroughly excercise the new commit->version-string procedure with the different arguments, and updated the documentation. Pushed in: 1dc3825e99 git: 'resolve-reference' handles 'git describe'-style commit I= Ds. 16ef7b4938 transformations: Git tags and 'git describe' style IDs are use= d as version. Thanks, Marius --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iIUEARYKAC0WIQRNTknu3zbaMQ2ddzTocYulkRQQdwUCYTjf7g8cbWFyaXVzQGdu dS5vcmcACgkQ6HGLpZEUEHeXPAEA0Sx3OdL8ncu1he5ExARMyYKv3ogMf4B0I87q DzmuqzEA/3aX9gvgDXvZKrVdqPJZJrmy+zHqMdXoEk3cJCFyde0H =JlKG -----END PGP SIGNATURE----- --=-=-=--