Re: [PATCH 0/2] more t/perf meson/GIT-BUILD-OPTIONS fallout
- From
Ramsay Jones <ramsay@ramsayjones.plus.com>
- Date
- Jan 6, 2026, 17:07 UTC
- Message-ID
- <1a430542-715e-4cf1-86f5-d9424951204a@ramsayjones.plus.com>
- In-Reply-To
- <20260106101043.GA3723319@coredump.intra.peff.net>
Hi Jeff,
On 06/01/2026 10:10 am, Jeff King wrote:
Show 9 quoted lines
> This series fixes two bugs when trying to use the t/perf/run script to > compare two versions of Git. > > [1/2]: t/perf/perf-lib: fix assignment of TEST_OUTPUT_DIRECTORY > [2/2]: t/perf/run: preserve GIT_PERF_* from environment > > t/perf/perf-lib.sh | 3 ++- > t/perf/run | 10 ++++++++++ > 2 files changed, 12 insertions(+), 1 deletion(-)
I hesitated to send this email because I have been reduced to simply skimming the git mailing list (very busy with other projects/real life!), and I may have misunderstood what you aim to do here. ;)
In essence, I was triggered by the 'GIT-BUILD-OPTIONS fallout' phrase in the subject line! That reminded me of a problem/patch I was looking at earlier this (wait, last) year. The patch (below) was a complete 'hack' (as you can see) to allow the environment to override the 'GIT-BUILD-OPTIONS' file. This was in an old branch named 'meson-wip' which I have been meaning to look at again to either delete or fix-up.
One of the many reasons (apart from being a disgusting hack) that I didn't progress this patch is because I felt that not all 'options' in that file should be able to be 'overridden'. So, that implies that the file needs to be split into two; one file of options which can be overridden from the environment and one that can't. If so, then someone has to decide which is which.
[I'm sure you could do a much better job than the patch below!]
BTW, I can't remember why I wanted to do this anyway ... :)
Hopefully, this is not a complete waste of the list's time. If so, sorry in advance!
Thanks.
ATB, Ramsay Jones
-------- >8 -------- Date: Tue, 27 May 2025 21:53:49 +0100 Subject: [PATCH] test-lib.sh: allow environment to override GIT-BUILD-OPTIONS
Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com> --- t/test-lib.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/t/test-lib.sh b/t/test-lib.sh index 621cd31ae1..5239042b97 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -101,7 +101,18 @@ then echo >&2 'error: GIT-BUILD-OPTIONS missing (has Git been built?).' exit 1 fi -. "$GIT_BUILD_DIR"/GIT-BUILD-OPTIONS + +# allow the environment to override the settings from GIT-BUILD-OPTIONS +while IFS== read var val +do + e_val=$(eval echo '${'"$var"'}' 2>/dev/null) + if test -n "$e_val" + then + val="'$e_val'" + fi + eval "$var"=$val +done < "$GIT_BUILD_DIR"/GIT-BUILD-OPTIONS + export PERL_PATH SHELL_PATH if test -z "$TEST_OUTPUT_DIRECTORY"
-- 2.52.0