mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-23 18:43:51 +08:00
64eaf7ca5a
This reverts functional changes in commitea3e9698df
. * Annotated tags only should be used for releases - see #3572 for examples of where we want to use lightweight tags. See also git-tag(1) on the purpose of annotated and lightweight tags. * Version numbers are numbers and should not start with a branch name. The commit ID is embedded in the version and uniquely identifies the history. `fish --version` and `echo $FISH_VERSION` contain this information. (cherry picked from commitdcb39bfa86
)
29 lines
687 B
Bash
Executable File
29 lines
687 B
Bash
Executable File
#!/bin/sh
|
|
# Originally from the git sources (GIT-VERSION-GEN)
|
|
# Presumably (C) Junio C Hamano <junkio@cox.net>
|
|
# Reused under GPL v2.0
|
|
# Modified for fish by David Adam <zanchey@ucc.gu.uwa.edu.au>
|
|
|
|
FBVF=FISH-BUILD-VERSION-FILE
|
|
DEF_VER=unknown
|
|
|
|
# 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 ! VN=$(git describe --always --dirty 2>/dev/null); then
|
|
VN="$DEF_VER"
|
|
fi
|
|
|
|
if test -r $FBVF
|
|
then
|
|
VC=$(sed -e 's/^FISH_BUILD_VERSION = //' <$FBVF)
|
|
else
|
|
VC=unset
|
|
fi
|
|
test "$VN" = "$VC" || {
|
|
echo >&2 "FISH_BUILD_VERSION = $VN"
|
|
echo "FISH_BUILD_VERSION = $VN" >$FBVF
|
|
}
|