diff options
author | Raphael Manfredi <Raphael_Manfredi@pobox.com> | 2016-04-01 11:39:19 +0200 |
---|---|---|
committer | Raphael Manfredi <Raphael_Manfredi@pobox.com> | 2016-04-01 11:39:19 +0200 |
commit | d630f9662f4b77f37714212748c615b3566618c2 (patch) | |
tree | be7f245c991b752fbb524d9871e6f7be302a79e9 | |
parent | 06ffc150b88e0d491a06f437acc44ed199fac216 (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-- | MANIFEST | 1 | ||||
-rwxr-xr-x | bin/svn-revision | 8 | ||||
-rw-r--r-- | revision.h | 7 |
3 files changed, 6 insertions, 10 deletions
@@ -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$" |