From c13d4bf616bbe682a59358a037a10cb1acb21419 Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Thu, 29 Oct 2026 15:43:47 -1000 Subject: Fold the version script into its make recipe gen-version.sh was only ever run by this one recipe, so tools/ now holds just the scripts a person runs. --- tools/gen-version.sh | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100755 tools/gen-version.sh (limited to 'tools/gen-version.sh') diff --git a/tools/gen-version.sh b/tools/gen-version.sh deleted file mode 100755 index ca8ea65..0000000 --- a/tools/gen-version.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh - -# Writes a "CGIT_VERSION = ..." line into the output file, which the build -# then includes. Run it from the project root, as gen-version.sh -# [output], so that git describe reports cgit rather than the bundled git -# submodule. The output file defaults to VERSION. - -version=$1 -output=${2:-VERSION} - -# Prefer what git describe reports, but only at the top of the cgit working -# tree, and keep the fallback when it has nothing to say, as in a shallow or -# tagless clone. -if test "$(git rev-parse --git-dir 2>/dev/null)" = '.git' -then - described=$(git describe --abbrev=4 HEAD 2>/dev/null) - test -n "$described" && version=$described -fi - -new="CGIT_VERSION = $version" -old=$(cat "$output" 2>/dev/null) - -# Leaving the file untouched when nothing changed keeps make from rebuilding -# everything that depends on it. -test "$old" = "$new" && exit 0 - -echo "$new" > "$output" -cat "$output" -- cgit