|
From: Zdenek S. <st...@us...> - 2017-03-19 17:40:57
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "ipmitool".
The branch, version-script has been created
at 532aead9367e3987b979c07e438a867be25dc666 (commit)
- Log -----------------------------------------------------------------
commit 532aead9367e3987b979c07e438a867be25dc666
Author: Alexander Amelkin <ale...@am...>
Date: Tue Feb 7 14:06:47 2017 +0300
Make git revision more descriptive
The previously introduced mechanism of generating
a git revision was only using the abbreviated hash.
That approach doesn't give a clue whether version
1.8.18.2c99bf6 is newer or older than 1.8.18.7f8d374.
The project uses tags, so `git describe` can be
employed to produce an incremental revision number
since the last tag. Version 1.8.18.13 is much more
understandable and comparable. Howerver that doesn't
answer the question "what codebase was used". To
address that, the abbreviated hash should also be
preserved. Hence, this commit introduces a new
versioning scheme like `1.8.18.13.gee01aa5`.
For git snapshots when git program is absent the
version will be like `1.8.18.0.gsnapshot`.
For cases when .git directory is missing (Release
compilation?) the suffix part will be omitted
completely yielding a version like `1.8.18`.
The suffix generation has been moved to the added
csv-revision script. The script is absolutely
POSIX-ly correct and doesn't require XSI or any
other POSIX extensions.
diff --git a/configure.ac b/configure.ac
index 88232a6..a67c3cf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,7 +1,8 @@
dnl
dnl autoconf for ipmitool
dnl
-AC_INIT([ipmitool], [1.8.18-csv])
+m4_define([git_suffix], m4_esyscmd_s(./csv-revision))
+AC_INIT([ipmitool], [1.8.18git_suffix])
AC_CONFIG_SRCDIR([src/ipmitool.c])
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE
diff --git a/csv-revision b/csv-revision
new file mode 100755
index 0000000..289c133
--- /dev/null
+++ b/csv-revision
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+git describe --first-parent --tags 2>/dev/null | (
+ IFS=- read tag rev hash
+ if [ $? ] && [ -n "$rev" ]; then
+ echo .$rev.$hash
+ elif [ -d .git ]; then
+ echo .0.gsnapshot
+ fi
+)
-----------------------------------------------------------------------
hooks/post-receive
--
ipmitool
|