]> git.sesse.net Git - ffmpeg/commitdiff
version.sh: Print versions based on the last git tag for release branches
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 28 Jul 2014 00:40:35 +0000 (02:40 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 28 Jul 2014 13:44:59 +0000 (15:44 +0200)
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

Reviewed-by: Timothy Gu <timothygu99@gmail.com>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit ee606fd0317df202b59946cf9b738c0a01056316)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
version.sh

index 92edcb9474ed86d641b2b2252f40f9c80399facb..f9754eb3cf23e29fbaf4eb6992d43d4431dcf518 100755 (executable)
@@ -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: