mirror of
https://github.com/git/git.git
synced 2024-11-24 02:17:02 +08:00
fcb2205b77
Now that the rest of the MIDX subsystem and relevant callers have been updated to learn about how to read and process incremental MIDX chains, let's finally update the implementation in `write_midx_internal()` to be able to write incremental MIDX chains. This new feature is available behind the `--incremental` option for the `multi-pack-index` builtin, like so: $ git multi-pack-index write --incremental The implementation for doing so is relatively straightforward, and boils down to a handful of different kinds of changes implemented in this patch: - The `compute_sorted_entries()` function is taught to reject objects which appear in any existing MIDX layer. - Functions like `write_midx_revindex()` are adjusted to write pack_order values which are offset by the number of objects in the base MIDX layer. - The end of `write_midx_internal()` is adjusted to move non-incremental MIDX files when necessary (i.e. when creating an incremental chain with an existing non-incremental MIDX in the repository). There are a handful of other changes that are introduced, like new functions to clear incremental MIDX files that are unrelated to the current chain (using the same "keep_hash" mechanism as in the non-incremental case). The tests explicitly exercising the new incremental MIDX feature are relatively limited for two reasons: 1. Most of the "interesting" behavior is already thoroughly covered in t5319-multi-pack-index.sh, which handles the core logic of reading objects through a MIDX. The new tests in t5334-incremental-multi-pack-index.sh are mostly focused on creating and destroying incremental MIDXs, as well as stitching their results together across layers. 2. A new GIT_TEST environment variable is added called "GIT_TEST_MULTI_PACK_INDEX_WRITE_INCREMENTAL", which modifies the entire test suite to write incremental MIDXs after repacking when combined with the "GIT_TEST_MULTI_PACK_INDEX" variable. This exercises the long tail of other interesting behavior that is defined implicitly throughout the rest of the CI suite. It is likewise added to the linux-TEST-vars job. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
60 lines
1.3 KiB
Bash
Executable File
60 lines
1.3 KiB
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# Build and test Git
|
|
#
|
|
|
|
. ${0%/*}/lib.sh
|
|
|
|
case "$CI_OS_NAME" in
|
|
windows*) cmd //c mklink //j t\\.prove "$(cygpath -aw "$cache_dir/.prove")";;
|
|
*) ln -s "$cache_dir/.prove" t/.prove;;
|
|
esac
|
|
|
|
run_tests=t
|
|
|
|
case "$jobname" in
|
|
linux-gcc)
|
|
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
|
;;
|
|
linux-TEST-vars)
|
|
export GIT_TEST_SPLIT_INDEX=yes
|
|
export GIT_TEST_MERGE_ALGORITHM=recursive
|
|
export GIT_TEST_FULL_IN_PACK_ARRAY=true
|
|
export GIT_TEST_OE_SIZE=10
|
|
export GIT_TEST_OE_DELTA_SIZE=5
|
|
export GIT_TEST_COMMIT_GRAPH=1
|
|
export GIT_TEST_COMMIT_GRAPH_CHANGED_PATHS=1
|
|
export GIT_TEST_MULTI_PACK_INDEX=1
|
|
export GIT_TEST_MULTI_PACK_INDEX_WRITE_INCREMENTAL=1
|
|
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master
|
|
export GIT_TEST_NO_WRITE_REV_INDEX=1
|
|
export GIT_TEST_CHECKOUT_WORKERS=2
|
|
export GIT_TEST_PACK_USE_BITMAP_BOUNDARY_TRAVERSAL=1
|
|
;;
|
|
linux-clang)
|
|
export GIT_TEST_DEFAULT_HASH=sha1
|
|
;;
|
|
linux-sha256)
|
|
export GIT_TEST_DEFAULT_HASH=sha256
|
|
;;
|
|
linux-reftable|linux-reftable-leaks|osx-reftable)
|
|
export GIT_TEST_DEFAULT_REF_FORMAT=reftable
|
|
;;
|
|
pedantic)
|
|
# Don't run the tests; we only care about whether Git can be
|
|
# built.
|
|
export DEVOPTS=pedantic
|
|
run_tests=
|
|
;;
|
|
esac
|
|
|
|
group Build make
|
|
if test -n "$run_tests"
|
|
then
|
|
group "Run tests" make test ||
|
|
handle_failed_tests
|
|
fi
|
|
check_unignored_build_artifacts
|
|
|
|
save_good_tree
|