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

[PATCH v2 1/2] t5319: replace 'touch -m' with 'test-tool chmtime'

From
Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>
Date
Apr 1, 2020, 21:00 UTC
Message-ID
<24e26ecda632421e4c1a61ebabf6ea78301685b1.1585774844.git.gitgitgadget@gmail.com>
In-Reply-To
<pull.596.v2.git.1585774844.gitgitgadget@gmail.com>
From: Derrick Stolee <dstolee@microsoft.com>

The use of 'touch -m' to modify a file's mtime is slightly less portable than using our own 'test-tool chmtime'. The important thing is that these pack-files are ordered in a special way to ensure the multi-pack-index selects some as the "newer" pack-files when resolving duplicate objects.

Reported-by: Jeff King <peff@peff.net>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
---
 t/t5319-multi-pack-index.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/t/t5319-multi-pack-index.sh b/t/t5319-multi-pack-index.sh
index 43a7a66c9d1..6b20e60314d 100755
--- a/t/t5319-multi-pack-index.sh
+++ b/t/t5319-multi-pack-index.sh
@@ -521,10 +521,10 @@ test_expect_success 'repack with minimum size does not alter existing packs' '
 		cd dup &&
 		rm -rf .git/objects/pack &&
 		mv .git/objects/pack-backup .git/objects/pack &&
-		touch -m -t 201901010000 .git/objects/pack/pack-D* &&
-		touch -m -t 201901010001 .git/objects/pack/pack-C* &&
-		touch -m -t 201901010002 .git/objects/pack/pack-B* &&
-		touch -m -t 201901010003 .git/objects/pack/pack-A* &&
+		test-tool chmtime =-5 .git/objects/pack/pack-D* &&
+		test-tool chmtime =-4 .git/objects/pack/pack-C* &&
+		test-tool chmtime =-3 .git/objects/pack/pack-B* &&
+		test-tool chmtime =-2 .git/objects/pack/pack-A* &&
 		ls .git/objects/pack >expect &&
 		MINSIZE=$(test-tool path-utils file-size .git/objects/pack/*pack | sort -n | head -n 1) &&
 		git multi-pack-index repack --batch-size=$MINSIZE &&
-- 
gitgitgadget
Previous: Derrick Stolee via GitGitGadgetNext: Junio C Hamano
Message 14 of 20 in “commit-graph: fix buggy --expire-time option”
  1. commit-graph: fix buggy --expire-time optionDerrick Stolee via GitGitGadget, Apr 1, 2020
  2. Derrick StoleeApr 1, 2020
  3. Taylor BlauApr 1, 2020
  4. Taylor BlauApr 1, 2020
  5. Eric SunshineApr 1, 2020
  6. SZEDER GáborApr 1, 2020
  7. Junio C HamanoApr 1, 2020
  8. Jeff KingApr 1, 2020
  9. Junio C HamanoApr 1, 2020
  10. Derrick StoleeApr 1, 2020
  11. Derrick StoleeApr 1, 2020
  12. 0/2 commit-graph: fix buggy --expire-time optionDerrick Stolee via GitGitGadget, Apr 1, 2020
  13. 2/2 commit-graph: fix buggy --expire-time optionDerrick Stolee via GitGitGadget, Apr 1, 2020
  14. 1/2 t5319: replace 'touch -m' with 'test-tool chmtime'Derrick Stolee via GitGitGadget, Apr 1, 2020
  15. Junio C HamanoApr 1, 2020
  16. Derrick StoleeApr 2, 2020
  17. Jeff KingApr 2, 2020
  18. Junio C HamanoApr 2, 2020
  19. Junio C HamanoApr 1, 2020
  20. Derrick StoleeApr 1, 2020

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.