mirror of
https://github.com/git/git
synced 2024-11-05 04:53:18 +00:00
3c2a3fdc38
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEE4fA2sf7nIh/HeOzvsLXohpav5ssFAmXX4zkACgkQsLXohpav 5ssYqRAAkVcMK1RgXJaa7CRp0LuCpBVyzzn6oAxhLwDlG0y20WfbaVc9TLQP5SGl nxAlGUMFTNdIcNES0gV0H+w1N/4j+WzjujGpssPHNl6/drRMFjUZRosQIczwJpP/ bxViF4QV3Tdl9xUPpn9gdt9GDez0HAhDBc48Vc/EYMakWq30KFcviHesiEIRmgaw IvSbmRNDBHm7wQ6DY70lug/THNDDVWdYYPirzJ+Q9N14JS8ARxEKOom2oQ4ycoG+ E9I88R4aP2Ohb8+kZoLrejFuMn0xPotO8LyrdQhfleJjQIjIFi50v1PYcAoL+2qf GXE7jY7KnN6Ebm2HY1dJSeK2aU1bgSIYdEmoqGcthE9ifwA+pjjPIRbO6ZnhAQ4p v2lIclXrSMbxI7YxhXIu9GujR3CpCfjk999s3hNPR41r3uvrl/2oBCryHurLqbDl WNCxjZxTt8nLNAjKU04W5OswDREJHZENuTHziBJoN4gSxHCskqjnSYXbLLJNvUzh I25fI52ZTGPx+cASC9lSslyocmDU+MubQi6v8+wzKO2yPQZw+nPuodA3f+KWg2Du gwSvwVwdyZxJy9Gq2RUExWl09GZHYq5snUNe1nqOAHbepNr6QWB6I6BRPv9pDCMU uNR6P7U2IKRqXYfUuFeW6QxhdqibnNA3Qc6Wr4Y7yyM1Au9SpGg= =c/2C -----END PGP SIGNATURE----- Git 2.44 Signed-off-by: Junio C Hamano <gitster@pobox.com>
40 lines
764 B
Bash
Executable file
40 lines
764 B
Bash
Executable file
#!/bin/sh
|
|
|
|
GVF=GIT-VERSION-FILE
|
|
DEF_VER=v2.44.0
|
|
|
|
LF='
|
|
'
|
|
|
|
# First see if there is a version file (included in release tarballs),
|
|
# then try git-describe, then default.
|
|
if test -f version
|
|
then
|
|
VN=$(cat version) || VN="$DEF_VER"
|
|
elif { test -d "${GIT_DIR:-.git}" || test -f .git; } &&
|
|
VN=$(git describe --match "v[0-9]*" HEAD 2>/dev/null) &&
|
|
case "$VN" in
|
|
*$LF*) (exit 1) ;;
|
|
v[0-9]*)
|
|
git update-index -q --refresh
|
|
test -z "$(git diff-index --name-only HEAD --)" ||
|
|
VN="$VN-dirty" ;;
|
|
esac
|
|
then
|
|
VN=$(echo "$VN" | sed -e 's/-/./g');
|
|
else
|
|
VN="$DEF_VER"
|
|
fi
|
|
|
|
VN=$(expr "$VN" : v*'\(.*\)')
|
|
|
|
if test -r $GVF
|
|
then
|
|
VC=$(sed -e 's/^GIT_VERSION = //' <$GVF)
|
|
else
|
|
VC=unset
|
|
fi
|
|
test "$VN" = "$VC" || {
|
|
echo >&2 "GIT_VERSION = $VN"
|
|
echo "GIT_VERSION = $VN" >$GVF
|
|
}
|