From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id eOx8ANIk02H7SQEAgWs5BA (envelope-from ) for ; Mon, 03 Jan 2022 17:31:14 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id cOKROdEk02ETiAAA9RJhRA (envelope-from ) for ; Mon, 03 Jan 2022 17:31:13 +0100 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 8B3412C5D3 for ; Mon, 3 Jan 2022 17:31:13 +0100 (CET) Received: from localhost ([::1]:49844 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n4QEq-0001ux-Eq for larch@yhetil.org; Mon, 03 Jan 2022 11:31:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:50472) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n4QDg-0001tX-1a for guix-devel@gnu.org; Mon, 03 Jan 2022 11:30:00 -0500 Received: from [2600:3c01:e000:267:0:a171:de7:c] (port=36416 helo=cascadia.aikidev.net) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n4QDe-0000iD-DM; Mon, 03 Jan 2022 11:29:59 -0500 Received: from localhost (unknown [IPv6:2600:3c01:e000:21:21:21:0:100e]) (Authenticated sender: vagrant@cascadia.debian.net) by cascadia.aikidev.net (Postfix) with ESMTPSA id B72541A982; Mon, 3 Jan 2022 08:29:53 -0800 (PST) From: Vagrant Cascadian To: Ludovic =?utf-8?Q?Court=C3=A8s?= Subject: Re: On raw strings in commit field In-Reply-To: <87mtkchl6i.fsf@gnu.org> References: <6e451a878b749d4afb6eede9b476e5faabb0d609.camel@gmail.com> <87y240hd48.fsf@yucca> <87mtkchl6i.fsf@gnu.org> Date: Mon, 03 Jan 2022 08:29:51 -0800 Message-ID: <87fsq4kcjk.fsf@ponder> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Host-Lookup-Failed: Reverse DNS lookup failed for 2600:3c01:e000:267:0:a171:de7:c (failed) Received-SPF: none client-ip=2600:3c01:e000:267:0:a171:de7:c; envelope-from=vagrant@debian.org; helo=cascadia.aikidev.net X-Spam_score_int: 8 X-Spam_score: 0.8 X-Spam_bar: / X-Spam_report: (0.8 / 5.0 requ) RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: guix-devel@gnu.org, Liliana Marie Prikler Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1641227473; 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: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=61rxVunbFvAjc1oP8Mf94UP7qehy6XOWhSilcz1Phyg=; b=nUSuUednl1KiBhKcJMFCRN/nI/vDXfvsnOtxk5b7Hlo32OwOL/NMClrhhj2faNZNq3qH63 g6ZHC/6qQX75+tXE+pNiY87AWGh+Eg0bxWd2MISVjiN73o/66Lyy1GaJUWZrZ0dmCZKmmI OPAb79f7nMuzjfxh06dXiM4MPkB5HTuIlCN6iJPDRm+mvguyCf5/8XdtcXMnFnKFQ2h+nL ipLtMmtRMEyYEeB2NjVfW5EQw6M1ruhSVGsUQ5RHDYTrmD0y+19vlwCUhd/EMfJB4kdFoa dpvBFGL3PlfWbrr+Gj17mHHBVn30j/ehinxlLqYkAqFvrzivsai2yOAn0bXo/A== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1641227473; a=rsa-sha256; cv=none; b=Od1+ULCCw/2ZVP/zjnqi32JKjmZVmpqmaOnmirTHNGBCD5L02n0WIPDjeo4IiNm5h4N7zc o6rwDA7Kv/eeDkwhq/ll9NB2/4KplZQKwsxYntLkDeM3k0W+nT8v8EGTHXodbvLXKYCrkx xd3MF/L1Q5QTvWFKToJlWbXs6DDYt6d9IvMziybhU/VO63tso9aLMcs8goyXTt2XsgFITI ScmAODztZ5hoPTERrVRBEb9JU7Ogk0P6Ro1iEjkNMaXZAakNtSbqmqdZfdRQevQfkU3Z03 SUcv2e9DAc5vSwfwNRKs2NcNER+3IOqv2In3womRp5U1PxwdFMigK+t5cynY/g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -2.59 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of "guix-devel-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-devel-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 8B3412C5D3 X-Spam-Score: -2.59 X-Migadu-Scanner: scn1.migadu.com X-TUID: FEw7CMw7vGbK On 2022-01-03, Ludovic Court=C3=A8s wrote: > Vagrant Cascadian skribis: > >> How about using the output of git describe, which can unambigously >> include the most relevent tag, the number of commits since that tag, and >> the commit hash: >> >> $ git describe --long --abbrev=3D41 >> v1.3.0-13278-g60661adfb8ffa28e1acfcfea27c6cc2fc70f88fe >> >> $ git describe --long --abbrev=3D41 v1.3.0 >> v1.3.0-0-ga0178d34f582b50e9bdbb0403943129ae5b560ff > > What does =E2=80=98git checkout=E2=80=99 do when passed such a string? D= oes it ignore > the tag part? Technically, I have not tried it where the tag no longer exists, but when the tag does exist, it checks it out. If the tag is moved or not longer exists and git does not handle that well, the fallback can be to the full commit id, e.g. the part without the vX.Y.Z-N-g, as it is the same as a commit ID. This at least documents both the tag at the time the committer updated the guix package, as well as the commit ID, with the ability to somewhat gracefully fall back to the raw commit ID. I daresay, it seems like the best of both worlds, with the main downside of being a little verbose. >> I *think* I've used such git references in the commit field of packages >> before, and guix seemed fine with it. Occasionally, I've seen git >> describe pick an odd tag to base on. Not sure how it interacts with >> software heritage, or multiple tags, or renamed tags... but in theory it >> could work, and would allow us to detect tag changes "upstream". > > For SWH, we need either a tag or a commit ID. The commit id can be programatically derived from the git describe format, if you know in fact it is the git describe format with the appropriate --long and --abbrev=3D41 arguments. live well, vagrant