[FFmpeg-devel] [PATCH 2/2] version.sh: Print versions based on the last git tag for release branches

Michael Niedermayer michaelni at gmx.at
Mon Jul 28 02:49:28 CEST 2014


release branches are detected by checking if "git" is not in RELEASE
This changes "N-64706-g2f71aeb" to "n2.3-8-g2f71aeb"
for git master theres no change

This should improve the readability of lists of versions which come from
more than 1 release branch or master + release. fate.ffmpeg.org is
one possible example

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
---
 version.sh |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/version.sh b/version.sh
index 92edcb9..f9754eb 100755
--- a/version.sh
+++ b/version.sh
@@ -4,7 +4,11 @@
 
 # check for git short hash
 if ! test "$revision"; then
-    revision=$(cd "$1" && git describe --tags --match N 2> /dev/null)
+    if (cd "$1" && grep git RELEASE 2> /dev/null >/dev/null) ; then
+        revision=$(cd "$1" && git describe --tags --match N 2> /dev/null)
+    else
+        revision=$(cd "$1" && git describe --tags --always 2> /dev/null)
+    fi
 fi
 
 # Shallow Git clones (--depth) do not have the N tag:
-- 
1.7.9.5



More information about the ffmpeg-devel mailing list