]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Add to -v --version commit date+(optional) trailing X char if some files are changed
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Sat, 26 Aug 2017 06:47:46 +0000 (08:47 +0200)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Sat, 26 Aug 2017 06:47:46 +0000 (08:47 +0200)
auxprogs/make_or_upd_vgversion_h

index 92b07086cb8eadb4c9f53ea47dc69d6a8b14f9f7..3bccb28297a4be0f49337d15af0296e9a81e70a1 100755 (executable)
@@ -4,7 +4,11 @@ extract_git_version()
 {
     if [ -d "$1"/.git ]
     then
-        git rev-parse --short=10 HEAD
+        REV=$(git show --format=%H#%ci -s $(git rev-parse HEAD) |
+                     sed -e 's/ .*//' -e 's/[0-9a-f]\{30\}#/#/' -e 's/-//g' \
+                         -e 's/#/-/')
+        X=$(git status -s -uno | sed -e 's/.*/X/')
+        echo $REV$X
     else
         echo "unknown"
     fi    
@@ -20,6 +24,11 @@ else
 /* Do not edit: file generated by auxprogs/make_or_upd_vgversion_h.
    This file defines VGGIT, used to report GIT revision
    when using command line options:  -v --version
+   The produced VGGIT format is 
+      hhhhhhhhhh-YYYYMMDDX
+   where hhhhhhhhhh is the first 10 characters of the HEAD commit
+         YYYYMMDD is the commit date
+         Trailing X is present if there are any (non untracked) modified files.
 */
 #define VGGIT "$(extract_git_version .)"
 EOF