git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] t/perf: add fallback for pre-bin-wrappers versions of git

From
Jeff King <peff@peff.net>
Date
Mar 3, 2017, 07:36 UTC
Message-ID
<20170303073633.maoaovchkz32h467@sigill.intra.peff.net>
In-Reply-To
<20170303071403.2k3vbcdstllq2j3y@sigill.intra.peff.net>
On Fri, Mar 03, 2017 at 02:14:03AM -0500, Jeff King wrote:
Show 6 quoted lines
> With this patch I was able to run p0001 against v1.7.0. I don't think we
> can go further back than that because the perf library depends on the
> presence of bin-wrappers. That's probably enough. Unlike the t/interop
> library I proposed recently it's not that interesting to go really far
> back in time (and I did hack around the bin-wrappers thing in t/interop;
> you really can test against v1.0.0 there).

This is easy to fix (see below). I doubt anybody cares, but it's probably worth fixing just because the failure mode (quietly running whatever git is in your PATH) is so confusing. It would also be an improvement to just detect the situation and die(), but this is literally not any more effort.

-- >8 --
Subject: [PATCH] t/perf: add fallback for pre-bin-wrappers versions of git
It's tempting to say:
  ./run v1.0.0 HEAD

to see how we've sped up Git over the years. Unfortunately, this doesn't quite work because versions of Git prior to v1.7.0 lack bin-wrappers, so our "run" script doesn't correctly put them in the PATH.

Worse, it means we silently find whatever other "git" is in the PATH, and produce test results that have no bearing on what we asked for.

Let's fallback to the main git directory when bin-wrappers isn't present. Many modern perf scripts won't run with such an antique version of Git, of course, but at least those failures are detected and reported (and you're free to write a limited perf script that works across many versions).

Signed-off-by: Jeff King <peff@peff.net>
---
 t/perf/run | 3 +++
 1 file changed, 3 insertions(+)
diff --git a/t/perf/run b/t/perf/run
index e8adedadf..c788d713a 100755
--- a/t/perf/run
+++ b/t/perf/run
@@ -63,6 +63,9 @@ run_dirs_helper () {
 		unset GIT_TEST_INSTALLED
 	else
 		GIT_TEST_INSTALLED="$mydir/bin-wrappers"
+		# Older versions of git lacked bin-wrappers; fallback to the
+		# files in the root.
+		test -d "$GIT_TEST_INSTALLED" || GIT_TEST_INSTALLED=$mydir
 		export GIT_TEST_INSTALLED
 	fi
 	run_one_dir "$@"
-- 
2.12.0.385.gdf4947bc7
Previous: Jeff KingNext: Junio C Hamano
Message 8 of 17 in “Test fetch-pack's ability to fetch arbitrary blobs”
  1. 0/3 Test fetch-pack's ability to fetch arbitrary blobsJonathan Tan, Feb 25, 2017
  2. 2/3 revision: exclude trees/blobs given commitJonathan Tan, Feb 25, 2017
  3. Junio C HamanoFeb 28, 2017
  4. Jeff KingFeb 28, 2017
  5. t/perf: export variable used in other blocksJonathan Tan, Mar 2, 2017
  6. Jeff KingMar 3, 2017
  7. t/perf: use $MODERN_GIT for all repo-copying stepsJeff King, Mar 3, 2017
  8. t/perf: add fallback for pre-bin-wrappers versions of gitJeff King, Mar 3, 2017
  9. Junio C HamanoMar 3, 2017
  10. Jeff KingMar 3, 2017
  11. Junio C HamanoFeb 28, 2017
  12. 1/3 revision: unify {tree,blob}_objects in rev_infoJonathan Tan, Feb 25, 2017
  13. Junio C HamanoFeb 28, 2017
  14. Jeff KingFeb 28, 2017
  15. Junio C HamanoMar 2, 2017
  16. Jeff KingFeb 28, 2017
  17. 3/3 upload-pack: compute blob reachability correctlyJonathan Tan, Feb 25, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.