Skip to content

Commit

Permalink
git: force-fully ignore the environment variable GIT_VERSION
Browse files Browse the repository at this point in the history
While it used to be possible to override the version shown in `git
version` via `make GIT_VERSION=...`, the same was not true of the
environment variable `GIT_VERSION`.

However, that changed in Git's 992bc5618f2 (GIT-VERSION-GEN: fix
overriding GIT_VERSION, 2024-12-20).

To force the build process to derive the version shown in the output of
`git version`, let's forcefully un-set the environment variable during
the build.

Signed-off-by: Johannes Schindelin <[email protected]>
  • Loading branch information
dscho committed Dec 31, 2024
1 parent ef444b8 commit 56d5c67
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions mingw-w64-git/PKGBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ build() {
CPPFLAGS="$(echo "$CPPFLAGS" |
sed 's/-D__USE_MINGW_ANSI_STDIO\(=[0-9]*\)\?//')"

# Guarantee that `GIT-VERSION-GEN` determines the version
unset GIT_VERSION

# Make git-bash.exe first, to avoid triggering `* new link flags`
rm -f *.res &&
make -f ../mingw-w64-git.mak git-wrapper.exe \
Expand Down

0 comments on commit 56d5c67

Please sign in to comment.