Skip to content

Commit

Permalink
gvfs: ensure that the version is based on a GVFS tag
Browse files Browse the repository at this point in the history
Since we really want to be based on a `.vfs.*` tag, let's make sure that
there was a new-enough one, i.e. one that agrees with the first three
version numbers of the recorded default version.

This prevents e.g. v2.22.0.vfs.0.<some-huge-number>.<commit> from being
used when the current release train was not yet tagged.

It is important to get the first three numbers of the version right
because e.g. Scalar makes decisions depending on those (such as assuming
that the `git maintenance` built-in is not available, even though it
actually _is_ available).

Signed-off-by: Johannes Schindelin <johasc@microsoft.com>
  • Loading branch information
dscho committed Aug 16, 2023
1 parent 3bcd88b commit 3233d29
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion GIT-VERSION-GEN
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,15 @@ if test -f version
then
VN=$(cat version) || VN="$DEF_VER"
elif test -d ${GIT_DIR:-.git} -o -f .git &&
VN=$(git describe --match "v[0-9]*" HEAD 2>/dev/null) &&
VN=$(git describe --match "v[0-9]*vfs*" HEAD 2>/dev/null) &&
case "$VN" in
*$LF*) (exit 1) ;;
v[0-9]*)
if test "${VN%%.vfs.*}" != "${DEF_VER%%.vfs.*}"
then
echo "Found version $VN, which is not based on $DEF_VER" >&2
exit 1
fi
git update-index -q --refresh
test -z "$(git diff-index --name-only HEAD --)" ||
VN="$VN-dirty" ;;
Expand Down

0 comments on commit 3233d29

Please sign in to comment.