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

[PATCH] t/perf: export variable used in other blocks

From
JTJonathan Tan <jonathantanmy@google.com>
Date
Mar 2, 2017, 19:50 UTC
Message-ID
<20170302195041.1699-1-jonathantanmy@google.com>
In-Reply-To
<20170228221236.selqkf5wme3fvued@sigill.intra.peff.net>

In p0001, a variable was created in a test_expect_success block to be used in later test_perf blocks, but was not exported. This caused the variable to not appear in those blocks (this can be verified by writing 'test -n "$commit"' in those blocks), resulting in a slightly different invocation than what was intended. Export that variable.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
---

Performance indeed does drop significantly with this patch. And I cannot say "at least this is more correct", because it isn't - as Peff thinks, it is indeed still not 100% accurate because of the resurfacing-object issue he mentions (I've verified this by constructing a test that fails even after this patch set).

Also, since we don't want to unify tree_ and blob_ (for the reason Peff mentioned in another e-mail), feel free to drop this patch set.

Having said that, while looking at the perf test, I noticed an issue with a non-exported variable, which is corrected in this patch.

 t/perf/p0001-rev-list.sh | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/t/perf/p0001-rev-list.sh b/t/perf/p0001-rev-list.sh
index 16359d51a..ebf172401 100755
--- a/t/perf/p0001-rev-list.sh
+++ b/t/perf/p0001-rev-list.sh
@@ -15,7 +15,8 @@ test_perf 'rev-list --all --objects' '
 '
 
 test_expect_success 'create new unreferenced commit' '
-	commit=$(git commit-tree HEAD^{tree} -p HEAD)
+	commit=$(git commit-tree HEAD^{tree} -p HEAD) &&
+	test_export commit
 '
 
 test_perf 'rev-list $commit --not --all' '
-- 
2.12.0.rc1.440.g5b76565f74-goog
Previous: Jeff KingNext: Jeff King
Message 5 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.