]> Savannah Git Hosting - gnulib.git/commitdiff
git-version-gen: Change suffix.
authorBruno Haible <bruno@clisp.org>
Tue, 28 Jan 2025 09:33:34 +0000 (10:33 +0100)
committerBruno Haible <bruno@clisp.org>
Tue, 28 Jan 2025 09:33:34 +0000 (10:33 +0100)
* doc/package-version.texi (Propagating the package version): Drop the
git-version-gen postprocessing line, that does not work on Solaris.
* build-aux/git-version-gen: Likewise. Produce a suffix '-modified'
instead of '-dirty'.

ChangeLog
build-aux/git-version-gen
doc/package-version.texi

index a18da52db3f94f8d530ace8a26e81dc2560fef23..bf91899783aac75b4779f42eca8e3d3ed01671d8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2025-01-28  Bruno Haible  <bruno@clisp.org>
+
+       git-version-gen: Change suffix.
+       * doc/package-version.texi (Propagating the package version): Drop the
+       git-version-gen postprocessing line, that does not work on Solaris.
+       * build-aux/git-version-gen: Likewise. Produce a suffix '-modified'
+       instead of '-dirty'.
+
 2025-01-26  Bruno Haible  <bruno@clisp.org>
 
        package-version: Avoid compiler warnings in config.log.
index 32c14e996d8bec3a3f3f98f9704fb59667dcc6fa..da6e131c03216aa3142050b62358b13925d1d6aa 100755 (executable)
@@ -1,6 +1,6 @@
 #!/bin/sh
 # Print a version string.
-scriptversion=2025-01-22.18; # UTC
+scriptversion=2025-01-28.09; # UTC
 
 # Copyright (C) 2007-2025 Free Software Foundation, Inc.
 #
@@ -59,8 +59,7 @@ scriptversion=2025-01-22.18; # UTC
 # AC_CONFIG_SRCDIR([@var{unique-file-in-source-dir}])
 # AC_CONFIG_AUX_DIR([build-aux])
 # VERSION_NUMBER=`cd $srcdir \
-#                 && build-aux/git-version-gen .tarball-version \
-#                    | sed -e 's/dirty$/modified/'`
+#                 && build-aux/git-version-gen .tarball-version`
 # gl_INIT_PACKAGE_VERSION([$VERSION_NUMBER])
 # AM_INIT_AUTOMAKE([@var{options}])
 #
@@ -213,20 +212,29 @@ v=`echo "$v" | sed 's/-\([^-]*\)-g\([^-]*\)$/.\1-\2/'`;
 
 v=`echo "$v" |sed "s/^$prefix//"`
 
-# Test whether to append the "-dirty" suffix only if the version
+# The "-modified" suffix was previously called "-dirty".  While this term
+# was invented by the git people to designate a checkout that is not "clean",
+# it has a negative connotation that is not in line with the fact that
+# a Free Software developer routinely works with modified source code.
+# In fact, modifying source code is the *essence* of Free Software.
+# What we need here is a term that is suitable for naming tarballs, without
+# shaming the developer.  Giving a name to a tarball is something else than
+# describing the state of a git checkout.
+#
+# Test whether to append the "-modified" suffix only if the version
 # string we're using came from git.  I.e., skip the test if it's "UNKNOWN"
 # or if it came from .tarball-version.
 if test "x$v_from_git" != x; then
-  # Don't declare a version "dirty" merely because a timestamp has changed.
+  # Don't declare a version "modified" merely because a timestamp has changed.
   git update-index --refresh > /dev/null 2>&1
 
-  dirty=`exec 2>/dev/null;git diff-index --name-only HEAD` || dirty=
-  case "$dirty" in
+  modified=`exec 2>/dev/null;git diff-index --name-only HEAD` || modified=
+  case "$modified" in
       '') ;;
       *) # Append the suffix only if there isn't one already.
           case $v in
-            *-dirty) ;;
-            *) v="$v-dirty" ;;
+            *-dirty | *-modified) ;;
+            *) v="$v-modified" ;;
           esac ;;
   esac
 fi
index dc8c8e8c55be68123f1dfcf67e3c221c002bdec6..b8aa9ff96b91091ef0b400fb51925dc061d6f693 100644 (file)
@@ -122,8 +122,7 @@ AC_INIT([@var{package}], [dummy])
 AC_CONFIG_SRCDIR([@var{unique-file-in-source-dir}])
 AC_CONFIG_AUX_DIR([build-aux])
 VERSION_NUMBER=`cd $srcdir \
-                && build-aux/git-version-gen .tarball-version \
-                   | sed -e 's/dirty$/modified/'`
+                && build-aux/git-version-gen .tarball-version`
 gl_INIT_PACKAGE_VERSION([$VERSION_NUMBER])
 AM_INIT_AUTOMAKE([@var{options}])
 @end example
@@ -151,8 +150,7 @@ The second such old code pattern
 is to invoke @code{git-version-gen} at @code{autoconf} time:
 @example
 AC_INIT([@var{package}],
-        m4_esyscmd([build-aux/git-version-gen .tarball-version \
-                    | sed -e 's/dirty$/modified/'])])
+        m4_esyscmd([build-aux/git-version-gen .tarball-version])])
 AC_CONFIG_SRCDIR([@var{unique-file-in-source-dir}])
 AC_CONFIG_AUX_DIR([build-aux])
 AM_INIT_AUTOMAKE([@var{options}])