]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
fix verbose version reporting for git
authorAustin English <austinenglish@gmail.com>
Sun, 26 Feb 2017 08:05:24 +0000 (02:05 -0600)
committerIvo Raisr <ivosh@ivosh.net>
Mon, 14 Aug 2017 13:27:36 +0000 (15:27 +0200)
Signed-off-by: Austin English <austinenglish@gmail.com>
auxprogs/make_or_upd_vgversion_h
coregrind/m_main.c

index 9a3bee3d96c6f534d06857d09b68d382b949c87c..92b07086cb8eadb4c9f53ea47dc69d6a8b14f9f7 100755 (executable)
@@ -1,14 +1,10 @@
 #!/bin/sh
 
-extract_svn_version()
+extract_git_version()
 {
-    if [ -d "$1"/.svn ]
+    if [ -d "$1"/.git ]
     then
-        svnversion -n "$1"
-    elif [ -d "$1"/.git/svn ]
-    then
-        cd "$1" || exit 1
-        git svn info . | grep '^Revision' | cut -d ' ' -f2 | tr -d '\n'
+        git rev-parse --short=10 HEAD
     else
         echo "unknown"
     fi    
@@ -22,18 +18,17 @@ then
 else
     cat > include/vgversion.h.tmp <<EOF
 /* Do not edit: file generated by auxprogs/make_or_upd_vgversion_h.
-   This file defines VGSVN and VEXSVN, used to report SVN revision
-   when using command line options:  -v --version 
+   This file defines VGGIT, used to report GIT revision
+   when using command line options:  -v --version
 */
-#define VGSVN "$(extract_svn_version "$srcdir/.")"
-#define VEXSVN "$(extract_svn_version "$srcdir/VEX")"
+#define VGGIT "$(extract_git_version .)"
 EOF
 fi
 
 if [ -f include/vgversion.h ]
 then
     # There is already a vgversion.h.
-    # Update it only if we found a different and real svn version
+    # Update it only if we found a different and real git version
     if grep -q unknown include/vgversion.h.tmp ||
        cmp -s include/vgversion.h include/vgversion.h.tmp
     then
index 044467f282ec0c859f4db3a8ac34e46a8dc21825..f2a16bdd16945614b53e4e13127a1023e51ef092 100644 (file)
@@ -428,7 +428,7 @@ static void early_process_cmd_line_options ( /*OUT*/Int* need_help )
       if (VG_(clo_verbosity) <= 1)
          VG_(printf)("valgrind-" VERSION "\n");
       else
-         VG_(printf)("valgrind-" VERSION "-" VGSVN "-vex-" VEXSVN "\n");
+         VG_(printf)("valgrind-" VERSION "-" VGGIT "\n");
       VG_(exit)(0);
    }