summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaphael Manfredi <Raphael_Manfredi@pobox.com>2016-04-01 11:39:19 +0200
committerRaphael Manfredi <Raphael_Manfredi@pobox.com>2016-04-01 11:39:19 +0200
commitd630f9662f4b77f37714212748c615b3566618c2 (patch)
treebe7f245c991b752fbb524d9871e6f7be302a79e9
parent06ffc150b88e0d491a06f437acc44ed199fac216 (diff)
Count amount of git revisions to compute a sub-version number, like SVN did.
Pun on sub-version and SVN intended :-) The idea is to be able to mimic what SVN was doing by counting how much changes were made on the master branch to derive a "build number" and keep our legacy version numbering scheme for now.
-rw-r--r--MANIFEST1
-rwxr-xr-xbin/svn-revision8
-rw-r--r--revision.h7
3 files changed, 6 insertions, 10 deletions
diff --git a/MANIFEST b/MANIFEST
index 9a26ff3..f15caea 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -752,4 +752,3 @@ pl/rcsargs.pl Perl library to expand rcs filename lists
pl/snapshot.pl Perl library to parse RCS snapshot file
pl/tilde.pl Perl library to perform ~name expansion
pl/users.pl Perl library to parse users file
-revision.h The current SVN revision number for dist
diff --git a/bin/svn-revision b/bin/svn-revision
index c698135..ea9db77 100755
--- a/bin/svn-revision
+++ b/bin/svn-revision
@@ -14,6 +14,10 @@
# Computes SVN current revision number, if possible, emitting it in
# the form of a #define for C perusal.
#
+# On 2016-04-01, we switched to git so until we come up with a more elaborate
+# scheme, the current version number is computed by counting the amount of
+# commits made on the "master" branch.
+#
LC_ALL=C
export LC_ALL
@@ -28,8 +32,8 @@ else
oldrev=`grep REVISION "$FILE" 2>/dev/null | head -n1 | cut -d' ' -f4`
fi
-if test -d "$TOP/.svn"; then
- revnum=`svn info "$TOP" 2>/dev/null | grep '^Revision' | head -n1 | cut -d' ' -f2`
+if test -d "$TOP/.git"; then
+ revnum=`git log --oneline master | wc -l`
else
revnum="$oldrev" # keep as is
fi
diff --git a/revision.h b/revision.h
deleted file mode 100644
index c686a10..0000000
--- a/revision.h
+++ /dev/null
@@ -1,7 +0,0 @@
-/*
- * THIS FILE IS AUTOMATICALLY GENERATED -- DO NOT EDIT
- *
- * Generated by ./bin/svn-revision.
- */
-
-#define REVISION "$Revision$"