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 <[email protected]>
  • Loading branch information
dscho committed Apr 23, 2024
1 parent 7171e5c commit 45448ec
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 @@ -15,10 +15,15 @@ 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) &&
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 45448ec

Please sign in to comment.