From: Xinglu Chen <public@yoctocell.xyz>
To: 48667@debbugs.gnu.org
Cc: "Ludovic Courtès" <ludo@gnu.org>,
"Maxime Devos" <maximedevos@telenet.be>
Subject: [bug#48667] [PATCH v2] doc: Add refernece for ‘git-version’ and ‘hg-version’.
Date: Sun, 06 Jun 2021 12:37:23 +0200 [thread overview]
Message-ID: <7354a84803acc09bb64feb8b94519b9e5093d050.1622975743.git.public@yoctocell.xyz> (raw)
In-Reply-To: <539a1a894dbbe25d5370b7bfb11006f736cbc875.1622971088.git.public@yoctocell.xyz>
* doc/contributing.texi (Version Numbers): Document ‘git-version’ and
‘hg-version’.
* doc/guix.texi (package Reference): Reference ‘Version Numbers’ section for
version naming guidelines.
---
Changes since v2:
* Fix typos
doc/contributing.texi | 22 +++++++++++++++++++---
doc/guix.texi | 4 +++-
2 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/doc/contributing.texi b/doc/contributing.texi
index 87719a4bbe..3e2a9c8d2f 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 way as @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
base-commit: 9caf7112ee50af26fbc4c1bd3c337f1f86b710af
--
2.31.1
next prev parent reply other threads:[~2021-06-06 10:38 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-26 9:00 [bug#48667] [PATCH] doc: Expound on how to specify the version of a package Xinglu Chen
2021-05-26 13:06 ` Nicolas Goaziou
2021-05-26 14:07 ` Xinglu Chen
2021-05-26 14:57 ` Xinglu Chen
2021-06-05 20:29 ` Ludovic Courtès
2021-06-06 9:09 ` Xinglu Chen
2021-06-06 9:19 ` [bug#48667] [PATCH] doc: Add reference for ‘git-ver Xinglu Chen
2021-06-06 9:48 ` Maxime Devos
2021-06-06 10:33 ` Xinglu Chen
2021-06-06 10:37 ` Xinglu Chen [this message]
2021-06-06 12:36 ` bug#48667: [PATCH v2] doc: Add refernece for ‘git-version’ and ‘hg-version’ Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7354a84803acc09bb64feb8b94519b9e5093d050.1622975743.git.public@yoctocell.xyz \
--to=public@yoctocell.xyz \
--cc=48667@debbugs.gnu.org \
--cc=ludo@gnu.org \
--cc=maximedevos@telenet.be \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).