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

[PATCH 10/17] test-lib.sh: add --packv4 for running the tests with pack v4 as default

From
Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Date
Sep 21, 2013, 13:57 UTC
Message-ID
<1379771883-10278-11-git-send-email-pclouds@gmail.com>
In-Reply-To
<1379771883-10278-1-git-send-email-pclouds@gmail.com>

--packv4 also sets prerequisite PACKV4, which can be used to disable v2-specific tests. You can run the test suite with

make test GIT_TEST_OPTS=--packv4
or just a specific test
./t5300-*.sh --packv4 -v -i
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
---
 builtin/pack-objects.c |  4 ++++
 t/test-lib.sh          | 10 ++++++++++
 2 files changed, 14 insertions(+)
diff --git a/builtin/pack-objects.c b/builtin/pack-objects.c
index 8e2e5e9..1e0c2e6 100644
--- a/builtin/pack-objects.c
+++ b/builtin/pack-objects.c
@@ -2735,6 +2735,10 @@ int cmd_pack_objects(int argc, const char **argv, const char *prefix)
 	if (!pack_compression_seen && core_compression_seen)
 		pack_compression_level = core_compression_level;
 
+	/* GIT_TEST_PACKV4 does not override --version */
+	if (getenv("GIT_TEST_PACKV4"))
+		pack_version = 4;
+
 	progress = isatty(2);
 	argc = parse_options(argc, argv, prefix, pack_objects_options,
 			     pack_usage, 0);
diff --git a/t/test-lib.sh b/t/test-lib.sh
index 1aa27bd..931dd23 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -222,6 +222,9 @@ do
 	--statusprefix=*)
 		statusprefix=$(expr "z$1" : 'z[^=]*=\(.*\)')
 		shift ;;
+	--packv4)
+		packv4=t
+		shift ;;
 	*)
 		echo "error: unknown test option '$1'" >&2; exit 1 ;;
 	esac
@@ -740,6 +743,13 @@ else
 	mkdir -p "$TRASH_DIRECTORY"
 fi
 
+if test -n "$packv4"
+then
+	GIT_TEST_PACKV4=t
+	export GIT_TEST_PACKV4
+	test_set_prereq PACKV4
+fi
+
 # Gross hack to spawn N sub-instances of the tests in parallel, and
 # summarize the results.  Note that if this is enabled, the script
 # terminates at the end of this 'if' block.
-- 
1.8.2.83.gc99314b
Previous: Nguyễn Thái Ngọc DuyNext: Nguyễn Thái Ngọc Duy
Message 12 of 25 in “np/pack-v4 updates”
  1. 00/17 np/pack-v4 updatesNguyễn Thái Ngọc Duy, Sep 21, 2013
  2. 01/17 fixup! index-pack: record all delta bases in v4 (tree and ref-delta)Nguyễn Thái Ngọc Duy, Sep 21, 2013
  3. 02/17 fixup! packv4-parse.c: add tree offset cachingNguyễn Thái Ngọc Duy, Sep 21, 2013
  4. 03/17 fixup! pack-objects: support writing pack v4Nguyễn Thái Ngọc Duy, Sep 21, 2013
  5. 04/17 fixup! pack-objects: recognize v4 as pack sourceNguyễn Thái Ngọc Duy, Sep 21, 2013
  6. 05/17 fixup! index-pack: support completing thin packs v4Nguyễn Thái Ngọc Duy, Sep 21, 2013
  7. 06/17 fixup! pack v4: move packv4-create.c to libgit.aNguyễn Thái Ngọc Duy, Sep 21, 2013
  8. 07/17 fixup! index-pack, pack-objects: allow creating .idx v2 with .pack v4Nguyễn Thái Ngọc Duy, Sep 21, 2013
  9. Nicolas PitreSep 22, 2013
  10. 08/17 fixup! pack v4: code to obtain a SHA1 from a sha1refNguyễn Thái Ngọc Duy, Sep 21, 2013
  11. 09/17 fixup! pack-objects: add --version to specify written pack versionNguyễn Thái Ngọc Duy, Sep 21, 2013
  12. 10/17 test-lib.sh: add --packv4 for running the tests with pack v4 as defaultNguyễn Thái Ngọc Duy, Sep 21, 2013
  13. 11/17 packv4-parse: accept ref-delta as base of pv4-treeNguyễn Thái Ngọc Duy, Sep 21, 2013
  14. 12/17 pack-objects: do not add type OBJ_NONE to objects[] in pack v4Nguyễn Thái Ngọc Duy, Sep 21, 2013
  15. 13/17 index-pack: encode appended trees using v4 format in pack v4Nguyễn Thái Ngọc Duy, Sep 21, 2013
  16. 14/17 t5302: disable sealth corruption tests when run with --packv4Nguyễn Thái Ngọc Duy, Sep 21, 2013
  17. Eric SunshineSep 22, 2013
  18. 15/17 t5300: avoid testing ofs-delta with --packv4Nguyễn Thái Ngọc Duy, Sep 21, 2013
  19. Nicolas PitreSep 21, 2013
  20. Duy NguyenSep 22, 2013
  21. Nicolas PitreSep 22, 2013
  22. 16/17 pack-objects: disable pack size limit feature on pack v4Nguyễn Thái Ngọc Duy, Sep 21, 2013
  23. 17/17 t5303: adapt the tests to run with --packv4Nguyễn Thái Ngọc Duy, Sep 21, 2013
  24. Nicolas PitreSep 21, 2013
  25. Junio C HamanoOct 15, 2013

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.