Hello there,

I would like to see the the following description of
a use-case included as a comment in git-version-gen.
Had this recipe been followed by GNU Inetutils,
then the reversal of my previous patch to git-version-gen
would never have been justified. For good or bad!

That lesson leads me also to this suggestion, with which
help and authoritative decisions are called for:

  * Implement a syntax check to assert that

      git-version-gen is used with a sed-script
      in configure.ac.

      ==>  git-version-gen-tag-sed-script is defined
           in cfg.mk.

Perhaps an even stronger check could find proponents:

     git-version-gen is used in configure.ac

     ==>  git-version-gen-tag-sed-script is defined in cfg.mk,
          possibly with an empty value

The failure for a project to specify a non-trivial value of
'git-version-gen-tag-sed-script', where a non-empty value
is used in 'configure.ac', is that the execution of "make dist"
will receive "UNKNOWN" from git-version-gen and issue a warning
since no match was possible, inspite of correct versioning of
the checked out source tree.

Best regards,
  Mats Erik Andersson, on behalf of GNU Inetutils
>From c83dddb36b1471975bcd7dd972c1916bcb66162a Mon Sep 17 00:00:00 2001
From: Mats Erik Andersson <g...@gisladisker.se>
Date: Fri, 17 Apr 2015 17:33:58 +0200
Subject: [PATCH] git-version-gen: add a use-case comment

* build-aux/git-version-gen: Add a further use-case
description in the preamble, demonstrating settings
with sed scripts used for tag mangling.
---
 build-aux/git-version-gen |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/build-aux/git-version-gen b/build-aux/git-version-gen
index 8e92c0a..b4ae499 100755
--- a/build-aux/git-version-gen
+++ b/build-aux/git-version-gen
@@ -68,6 +68,22 @@ scriptversion=2014-12-02.19; # UTC
 #	echo $(VERSION) > $@-t && mv $@-t $@
 # dist-hook:
 #	echo $(VERSION) > $(distdir)/.tarball-version
+#
+# The use case just described presumes that tags are prefixed with
+# the single character "v".  Projects prefering other tag naming
+# conventions have the option of supplying a normalizing sed script
+# to git-version-gen in configure.ac; an entry now taking the form
+#
+# AC_INIT([GNU project],
+#   m4_esyscmd([build-aux/git-version-gen .tarball-version 's/our/v/']),
+#   [bug-project@example])
+#
+# It is important, however, for retaining the expected functionality,
+# that the identical sed script also is included in cfg.mk:
+#
+# git-version-gen-tag-sed-script = 's/our/v/'
+#
+# Failure to do so could have adverse effects during 'make dist'.
 
 
 me=$0
-- 
1.7.3.2

Reply via email to