From patchwork Sun Jun 6 09:19:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Xinglu Chen X-Patchwork-Id: 29961 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 0D5A827BC81; Sun, 6 Jun 2021 10:20:12 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, T_DKIM_INVALID,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 3E6F127BC78 for ; Sun, 6 Jun 2021 10:20:08 +0100 (BST) Received: from localhost ([::1]:49678 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lpowx-0003Iq-8t for patchwork@mira.cbaines.net; Sun, 06 Jun 2021 05:20:07 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36150) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lpows-0003Ie-0A for guix-patches@gnu.org; Sun, 06 Jun 2021 05:20:02 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39106) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lpowr-00049q-Pi for guix-patches@gnu.org; Sun, 06 Jun 2021 05:20:01 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lpowr-0005ZE-MC for guix-patches@gnu.org; Sun, 06 Jun 2021 05:20:01 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#48667] [PATCH] doc: Add reference for =?utf-8?q?=E2=80=98git-v?= =?utf-8?q?er?= Resent-From: Xinglu Chen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 06 Jun 2021 09:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48667 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 48667@debbugs.gnu.org Cc: Ludovic =?utf-8?q?Court=C3=A8s?= Received: via spool by 48667-submit@debbugs.gnu.org id=B48667.162297118621374 (code B ref 48667); Sun, 06 Jun 2021 09:20:01 +0000 Received: (at 48667) by debbugs.gnu.org; 6 Jun 2021 09:19:46 +0000 Received: from localhost ([127.0.0.1]:50652 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lpowb-0005Yf-Kt for submit@debbugs.gnu.org; Sun, 06 Jun 2021 05:19:45 -0400 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:50614 helo=mail.yoctocell.xyz) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lpowZ-0005YS-FG for 48667@debbugs.gnu.org; Sun, 06 Jun 2021 05:19:43 -0400 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=yoctocell.xyz; s=mail; t=1622971177; bh=i91TOKKaLLOjgBVdXAtU4eAIfrA2ZplDCbgUfR2ngh8=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=n9r1/OaaLVc5NaAFftrVjtaf2ZjX+wkP0YE6724L53vlW2qeT3kBkZ1cce7gnrAYE 4ImyOQ5LC2P7RkSjdwZ3hsnPR8XTQOfhy48DiZ221fPf/BLX7e0F6fEZl8T14dKjmT 34E82/VH0IxHaO5UObuvQGAhesDruIrf+SgHBJlo= In-Reply-To: <87zgw4m4xa.fsf_-_@gnu.org> References: <87zgw4m4xa.fsf_-_@gnu.org> Message-Id: <539a1a894dbbe25d5370b7bfb11006f736cbc875.1622971088.git.public@yoctocell.xyz> Date: Sun, 06 Jun 2021 11:19:37 +0200 MIME-Version: 1.0 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+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches * doc/contributing.texi (Version Numbers): Document ‘git-version’ and ‘hg-version’. * doc/guix.texi (package Reference): Reference ‘Version Numbers’ section for version naming guidelines. --- doc/contributing.texi | 22 +++++++++++++++++++--- doc/guix.texi | 4 +++- 2 files changed, 22 insertions(+), 4 deletions(-) base-commit: 9caf7112ee50af26fbc4c1bd3c337f1f86b710af diff --git a/doc/contributing.texi b/doc/contributing.texi index 87719a4bbe..ee6cb97c8d 100644 --- a/doc/contributing.texi +++ b/doc/contributing.texi @@ -532,9 +532,11 @@ It is a good idea to strip commit identifiers in the @code{version} field to, say, 7 digits. It avoids an aesthetic annoyance (assuming aesthetics have a role to play here) as well as problems related to OS limits such as the maximum shebang length (127 bytes for the Linux -kernel). It is best to use the full commit identifiers in -@code{origin}s, though, to avoid ambiguities. A typical package -definition may look like this: +kernel). There are helper functions for doing this for packages using +@code{git-fetch} or @code{hg-fetch} (see below). It is best to use the +full commit identifiers in @code{origin}s, though, to avoid ambiguities. +A typical package definition may look like this: + @lisp (define my-package @@ -553,6 +555,20 @@ definition may look like this: ))) @end lisp +@deffn {Scheme Procedure} git-version @var{VERSION} @var{REVISION} @var{COMMIT} +Return the version string for packages using @code{git-fetch}. + +@lisp +(git-version "0.2.3" "0" "93818c936ee7e2f1ba1b315578bde363a7d43d05") +@result{} "0.2.3-0.93818c9" +@end lisp +@end deffn + +@deffn {Scheme Procedure} hg-version @var{VERSION} @var{REVISION} @var{CHANGESET} +Return the version string for packages using @code{hg-fetch}. It works +in the same was @code{git-version} +@end deffn + @node Synopses and Descriptions @subsection Synopses and Descriptions diff --git a/doc/guix.texi b/doc/guix.texi index eb64518a95..e71ec70859 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -89,6 +89,7 @@ Copyright @copyright{} 2020 Jonathan Brielmaier@* Copyright @copyright{} 2020 Edgar Vincent@* Copyright @copyright{} 2021 Maxime Devos@* Copyright @copyright{} 2021 B. Wilson@* +Copyright @copyright{} 2021 Xinglu Chen@* Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or @@ -6657,7 +6658,8 @@ This is the data type representing a package recipe. The name of the package, as a string. @item @code{version} -The version of the package, as a string. +The version of the package, as a string. @xref{Version Numbers}, for +guidelines. @item @code{source} An object telling how the source code for the package should be