[FFmpeg-devel] [PATCH] version.sh: Always use latest tag for generated version number
Hendrik Leppkes
h.leppkes at gmail.com
Thu Mar 3 23:07:34 CET 2016
Am 03.03.2016 22:46 schrieb "Timo Rothenpieler" <timo at rothenpieler.org>:
>
> The version numbers based on the 15 years old N tag are confusing and
> don't offer a lot of information about what release the version is close
> to.
>
> This patch stops using the N tag and always bases it on the most recent
> dev tag instead. So instead of
>
> N-78885-g966eade
>
> One now gets
>
> n3.1-dev-422-g966eade
>
> Which offers a lot more informational value to users and developers.
> ---
> version.sh | 9 ++++-----
> 1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/version.sh b/version.sh
> index a9d7e39..1c3faf1 100755
> --- a/version.sh
> +++ b/version.sh
> @@ -4,11 +4,10 @@
>
> # check for git short hash
> if ! test "$revision"; then
> - 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
> + # Optional fetch to make sure latest tags are present
> + (cd "$1" && timeout 10 git fetch --quiet "
https://git.videolan.org/git/ffmpeg.git" "refs/tags/*:refs/tags/*" >
/dev/null 2>&1)
> +
> + revision=$(cd "$1" && git describe --tags --always 2> /dev/null)
> fi
>
> # Shallow Git clones (--depth) do not have the N tag:
> --
Accessing a remote URL in the version script seems like a bad idea to me.
- Hendrik
More information about the ffmpeg-devel
mailing list