git/builtin
Taylor Blau fcb2205b77 midx: implement support for writing incremental MIDX chains
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>
2024-08-06 12:01:39 -07:00
..
add.c add-i: finally retire add.interactive.useBuiltin 2024-06-05 14:53:26 -07:00
am.c Merge branch 'ps/leakfixes-more' 2024-07-08 14:53:10 -07:00
annotate.c
apply.c apply: fix uninitialized hash function 2024-05-21 09:07:48 -07:00
archive.c Merge branch 'ps/leakfixes-more' 2024-07-08 14:53:10 -07:00
bisect.c global: improve const correctness when assigning string constants 2024-06-07 10:30:48 -07:00
blame.c Merge branch 'ps/leakfixes-more' 2024-07-08 14:53:10 -07:00
branch.c Merge branch 'kn/ref-transaction-symref' 2024-05-20 11:20:04 -07:00
bugreport.c global: improve const correctness when assigning string constants 2024-06-07 10:30:48 -07:00
bundle.c builtin/bundle: abort "verify" early when there is no repository 2024-05-06 22:50:49 -07:00
cat-file.c object-name: free leaking object contexts 2024-06-11 13:15:05 -07:00
check-attr.c builtin: stop using `the_index` 2024-04-18 12:30:42 -07:00
check-ignore.c global: improve const correctness when assigning string constants 2024-06-07 10:30:48 -07:00
check-mailmap.c
check-ref-format.c
checkout--worker.c
checkout-index.c builtin: stop using `the_index` 2024-04-18 12:30:42 -07:00
checkout.c checkout: clarify memory ownership in `unique_tracking_name()` 2024-05-27 11:19:58 -07:00
clean.c builtin: stop using `the_index` 2024-04-18 12:30:42 -07:00
clone.c Merge branch 'ps/leakfixes-more' 2024-07-08 14:53:10 -07:00
column.c
commit-graph.c
commit-tree.c commit: fix leaking parents when calling `commit_tree_extended()` 2024-06-11 13:15:07 -07:00
commit.c Merge branch 'ps/leakfixes-more' 2024-07-08 14:53:10 -07:00
config.c Merge branch 'ps/leakfixes' 2024-06-06 12:49:23 -07:00
count-objects.c
credential-cache--daemon.c Merge branch 'bc/credential-scheme-enhancement' 2024-05-08 10:18:44 -07:00
credential-cache.c Merge branch 'bc/credential-scheme-enhancement' 2024-05-08 10:18:44 -07:00
credential-store.c
credential.c builtin/credential: clear credential before exit 2024-05-27 11:20:01 -07:00
describe.c Merge branch 'as/describe-broken-refresh-index-fix' 2024-07-15 10:11:40 -07:00
diagnose.c global: improve const correctness when assigning string constants 2024-06-07 10:30:48 -07:00
diff-files.c
diff-index.c
diff-tree.c builtin: stop using `the_index` 2024-04-18 12:30:42 -07:00
diff.c builtin/diff: explicitly set hash algo when there is no repo 2024-05-06 22:50:49 -07:00
difftool.c Merge branch 'ps/leakfixes-more' 2024-07-08 14:53:10 -07:00
fast-export.c hash: require hash algorithm in `oidread()` and `oidclr()` 2024-06-14 10:26:32 -07:00
fast-import.c hash: require hash algorithm in `is_empty_{blob,tree}_oid()` 2024-06-14 10:26:33 -07:00
fetch-pack.c hash: require hash algorithm in `oidread()` and `oidclr()` 2024-06-14 10:26:32 -07:00
fetch.c Merge branch 'kn/update-ref-symref' 2024-06-20 15:45:12 -07:00
fmt-merge-msg.c parse-options: fix leaks for users of OPT_FILENAME 2024-06-11 13:15:04 -07:00
for-each-ref.c ref-filter: properly distinuish pseudo and root refs 2024-05-15 07:30:52 -07:00
for-each-repo.c for-each-repo: optionally keep going on an error 2024-04-24 10:46:03 -07:00
fsck.c cocci: apply rules to rewrite callers of "refs" interfaces 2024-05-07 10:06:59 -07:00
fsmonitor--daemon.c
gc.c Merge branch 'js/for-each-repo-keep-going' into maint-2.45 2024-06-28 15:53:08 -07:00
get-tar-commit-id.c
grep.c object-name: free leaking object contexts 2024-06-11 13:15:05 -07:00
hash-object.c builtin/hash-object: fix uninitialized hash function 2024-05-21 09:05:13 -07:00
help.c
hook.c
index-pack.c hash: require hash algorithm in `oidread()` and `oidclr()` 2024-06-14 10:26:32 -07:00
init-db.c refs: convert ref storage format to an enum 2024-06-06 09:04:31 -07:00
interpret-trailers.c Merge branch 'la/hide-trailer-info' 2024-05-23 11:04:27 -07:00
log.c Merge branch 'ps/leakfixes-more' 2024-07-08 14:53:10 -07:00
ls-files.c
ls-remote.c Merge branch 'jk/remote-wo-url' 2024-07-02 09:59:01 -07:00
ls-tree.c object-name: free leaking object contexts 2024-06-11 13:15:05 -07:00
mailinfo.c
mailsplit.c global: improve const correctness when assigning string constants 2024-06-07 10:30:48 -07:00
merge-base.c
merge-file.c
merge-index.c builtin: stop using `the_index` 2024-04-18 12:30:42 -07:00
merge-ours.c
merge-recursive.c builtin/merge-recursive: fix leaking object ID bases 2024-06-11 13:15:06 -07:00
merge-tree.c merge: fix leaking merge bases 2024-06-11 13:15:08 -07:00
merge.c Merge branch 'ps/leakfixes-more' 2024-07-08 14:53:10 -07:00
mktag.c
mktree.c
multi-pack-index.c midx: implement support for writing incremental MIDX chains 2024-08-06 12:01:39 -07:00
mv.c mv: replace src_dir with a strvec 2024-05-30 08:55:29 -07:00
name-rev.c cocci: apply rules to rewrite callers of "refs" interfaces 2024-05-07 10:06:59 -07:00
notes.c hash: require hash algorithm in `oidread()` and `oidclr()` 2024-06-14 10:26:32 -07:00
pack-objects.c Merge branch 'ps/use-the-repository' 2024-07-02 09:59:00 -07:00
pack-redundant.c hash: require hash algorithm in `oidread()` and `oidclr()` 2024-06-14 10:26:32 -07:00
pack-refs.c
patch-id.c hash: require hash algorithm in `oidread()` and `oidclr()` 2024-06-14 10:26:32 -07:00
prune-packed.c
prune.c
pull.c Merge branch 'ps/use-the-repository' 2024-07-02 09:59:00 -07:00
push.c remote: drop checks for zero-url case 2024-06-14 09:34:39 -07:00
range-diff.c
read-tree.c builtin: stop using `the_index` 2024-04-18 12:30:42 -07:00
rebase.c Merge branch 'pw/rebase-i-error-message' 2024-06-20 15:45:15 -07:00
receive-pack.c Merge branch 'ps/use-the-repository' 2024-07-02 09:59:00 -07:00
reflog.c refs: remove `dwim_log()` 2024-05-17 10:33:39 -07:00
refs.c builtin/refs: new command to migrate ref storage formats 2024-06-06 09:04:34 -07:00
remote-ext.c
remote-fd.c
remote.c Merge branch 'jk/remote-wo-url' 2024-07-02 09:59:01 -07:00
repack.c midx: implement support for writing incremental MIDX chains 2024-08-06 12:01:39 -07:00
replace.c hash: require hash algorithm in `oidread()` and `oidclr()` 2024-06-14 10:26:32 -07:00
replay.c commit: fix leaking parents when calling `commit_tree_extended()` 2024-06-11 13:15:07 -07:00
rerere.c
reset.c Merge branch 'ps/refs-without-the-repository' 2024-05-16 10:10:14 -07:00
rev-list.c builtin/rev-list: fix leaking bitmap index when calculating disk usage 2024-06-11 13:15:05 -07:00
rev-parse.c object-name: free leaking object contexts 2024-06-11 13:15:05 -07:00
revert.c global: improve const correctness when assigning string constants 2024-06-07 10:30:48 -07:00
rm.c hash: require hash algorithm in `oidread()` and `oidclr()` 2024-06-14 10:26:32 -07:00
send-pack.c send-pack: always allocate receive status 2024-06-07 10:30:53 -07:00
shortlog.c revision: free diff options 2024-06-11 13:15:06 -07:00
show-branch.c cocci: apply rules to rewrite callers of "refs" interfaces 2024-05-07 10:06:59 -07:00
show-index.c
show-ref.c Merge branch 'jc/heads-are-branches' 2024-06-20 15:45:17 -07:00
sparse-checkout.c Merge branch 'ps/leakfixes-more' 2024-07-08 14:53:10 -07:00
stash.c Merge branch 'aj/stash-staged-fix' into maint-2.45 2024-06-28 15:53:07 -07:00
stripspace.c
submodule--helper.c Merge branch 'rs/simplify-submodule-helper-super-prefix-invocation' 2024-07-12 08:41:58 -07:00
symbolic-ref.c Merge branch 'kn/ref-transaction-symref' 2024-05-20 11:20:04 -07:00
tag.c hash: require hash algorithm in `oidread()` and `oidclr()` 2024-06-14 10:26:32 -07:00
unpack-file.c
unpack-objects.c hash: require hash algorithm in `oidread()` and `oidclr()` 2024-06-14 10:26:32 -07:00
update-index.c refs: refactor `resolve_gitlink_ref()` to accept a repository 2024-05-17 10:33:38 -07:00
update-ref.c Merge branch 'ps/use-the-repository' 2024-07-02 09:59:00 -07:00
update-server-info.c
upload-archive.c
upload-pack.c Sync with 2.44.1 2024-04-29 20:42:30 +02:00
var.c refs: drop `git_default_branch_name()` 2024-05-17 10:33:39 -07:00
verify-commit.c
verify-pack.c
verify-tag.c
worktree.c Merge branch 'ps/leakfixes' 2024-06-06 12:49:23 -07:00
write-tree.c builtin: stop using `the_index` 2024-04-18 12:30:42 -07:00