]> git.ipfire.org Git - thirdparty/git.git/commitdiff
git-gui: make output of GIT-VERSION-GEN source'able
authorPatrick Steinhardt <ps@pks.im>
Mon, 12 May 2025 09:27:37 +0000 (11:27 +0200)
committerPatrick Steinhardt <ps@pks.im>
Tue, 13 May 2025 06:27:11 +0000 (08:27 +0200)
The output of GIT-VERSION-GEN can be sourced by our Makefile to make the
version available there. The output has a couple of spaces around the
equals sign, which is perfectly valid for parsing it in our Makefile.
But in subsequent steps we'll also want to source the file in a couple
of newly-introduced shell scripts, but having spaces around variable
assignments is invalid there.

Prepare for this step by dropping the spaces surrounding the equals
sign. Like this, we can easily use the same file both in our Makefile
and in shell scripts.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
GIT-VERSION-GEN

index e40a09b6fd6553a3e8b3ae650dc319dd4bfc62b2..c2767b4136cbbf85fa2c70a558030d7fd47c176a 100755 (executable)
@@ -84,11 +84,11 @@ esac
 
 if test -r "$OUTPUT"
 then
-       VC=$(sed -e 's/^GITGUI_VERSION = //' <"$OUTPUT")
+       VC=$(sed -e 's/^GITGUI_VERSION=//' <"$OUTPUT")
 else
        VC=unset
 fi
 test "$VN" = "$VC" || {
-       echo >&2 "GITGUI_VERSION = $VN"
-       echo "GITGUI_VERSION = $VN" >"$OUTPUT"
+       echo >&2 "GITGUI_VERSION=$VN"
+       echo "GITGUI_VERSION=$VN" >"$OUTPUT"
 }