Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
e691395
environment: move access to core.maxTreeDepth into repo settings
rscharfe Jan 9, 2026
2b74f68
tree: add repo_parse_tree*()
rscharfe Jan 9, 2026
548aaf9
add-interactive: use repo_parse_tree_indirect()
rscharfe Jan 9, 2026
83131ed
bloom: use repo_parse_tree()
rscharfe Jan 9, 2026
d54eb12
delta-islands: use repo_parse_tree()
rscharfe Jan 9, 2026
fd64c6f
pack-bitmap-write: use repo_parse_tree()
rscharfe Jan 9, 2026
d473865
path-walk: use repo_parse_tree_gently()
rscharfe Jan 9, 2026
e61c387
tree: use repo_parse_tree()
rscharfe Jan 9, 2026
a8a50f2
tree: stop using the_repository
rscharfe Jan 9, 2026
ec7a16b
cocci: convert parse_tree functions to repo_ variants
rscharfe Jan 9, 2026
cc06d7e
Merge branch 'ps/repack-avoid-noop-midx-rewrite' into tb/midx-write-c…
gitster Jan 13, 2026
e16ac6c
t/t5319-multi-pack-index.sh: drop early 'test_done'
ttaylorr Jan 12, 2026
38b72e5
midx-write.c: assume checksum-invalid MIDXs require an update
ttaylorr Jan 12, 2026
0cd306e
builtin/pack-objects: exclude promisor objects with "--stdin-packs"
pks-t Jan 5, 2026
861248b
repack-geometry: extract function to compute repacking split
pks-t Jan 5, 2026
dd8c4e1
repack-promisor: extract function to finalize repacking
pks-t Jan 5, 2026
fa7b912
repack-promisor: extract function to remove redundant packs
pks-t Jan 5, 2026
dcc9c7e
builtin/repack: handle promisor packs with geometric repacking
pks-t Jan 5, 2026
5814b04
Documentation/config: fix replacement for --get-urlmatch
pushkarscripts Jan 15, 2026
4eb105c
cocci: remove obsolete the_repository rules
rscharfe Jan 15, 2026
070fa41
Merge branch 'ps/geometric-repacking-with-promisor-remotes'
gitster Jan 22, 2026
e13de9e
Merge branch 'tb/midx-write-corrupt-checksum-fix'
gitster Jan 22, 2026
c0b4d20
Merge branch 'ps/config-doc-get-urlmatch-fix'
gitster Jan 22, 2026
214cbb7
Merge branch 'rs/tree-wo-the-repository'
gitster Jan 22, 2026
1faf5b0
A few on top of -rc1
gitster Jan 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Documentation/RelNotes/2.53.0.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ Performance, Internal Implementation, Development Support etc.
* Further preparation to upstream symbolic link support on Windows.
* Remove implicit reliance on the_repository global in the APIs
around tree objects and make it explicit which repository to work
in.
Fixes since v2.52
-----------------
Expand Down Expand Up @@ -280,6 +284,12 @@ Fixes since v2.52
terminating newline, which has been corrected.
(merge a8227ae8d5 kt/http-backend-errors later to maint).

* "git repack --geometric" did not work with promisor packs, which
has been corrected.

* The logic that avoids reusing MIDX files with a wrong checksum was
broken, which has been corrected.

* Other code cleanup, docfix, build fix, etc.
(merge 46207a54cc qj/doc-http-bad-want-response later to maint).
(merge df90eccd93 kh/doc-commit-extra-references later to maint).
Expand Down Expand Up @@ -311,3 +321,4 @@ Fixes since v2.52
(merge 3f051fc9c9 kh/doc-patch-id later to maint).
(merge 555c8464e5 je/doc-reset later to maint).
(merge 220f888d7e ps/t1410-cleanup later to maint).
(merge 5814b04c02 ps/config-doc-get-urlmatch-fix later to maint).
2 changes: 1 addition & 1 deletion Documentation/git-config.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ recommended to migrate to the new syntax.
Replaced by `git config get --all --show-names --regexp <name-regexp>`.
--get-urlmatch <name> <URL>::
Replaced by `git config get --all --show-names --url=<URL> <name>`.
Replaced by `git config get --url=<URL> <name>`.
--get-color <name> [<default>]::
Replaced by `git config get --type=color [--default=<default>] <name>`.
Expand Down
2 changes: 1 addition & 1 deletion add-interactive.c
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,7 @@ static int run_revert(struct add_i_state *s, const struct pathspec *ps,
if (is_initial)
oidcpy(&oid, s->r->hash_algo->empty_tree);
else {
tree = parse_tree_indirect(&oid);
tree = repo_parse_tree_indirect(s->r, &oid);
if (!tree) {
res = error(_("Could not parse HEAD^{tree}"));
goto finish_revert;
Expand Down
2 changes: 1 addition & 1 deletion archive.c
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ static void parse_treeish_arg(const char **argv,
if (ar_args->mtime_option)
archive_time = approxidate(ar_args->mtime_option);

tree = parse_tree_indirect(&oid);
tree = repo_parse_tree_indirect(the_repository, &oid);
if (!tree)
die(_("not a tree object: %s"), oid_to_hex(&oid));

Expand Down
2 changes: 1 addition & 1 deletion bloom.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ static void init_truncated_large_filter(struct bloom_filter *filter,

static int has_entries_with_high_bit(struct repository *r, struct tree *t)
{
if (parse_tree(t))
if (repo_parse_tree(r, t))
return 1;

if (!(t->object.flags & VISITED)) {
Expand Down
10 changes: 5 additions & 5 deletions builtin/am.c
Original file line number Diff line number Diff line change
Expand Up @@ -1998,7 +1998,7 @@ static int fast_forward_to(struct tree *head, struct tree *remote, int reset)
struct unpack_trees_options opts;
struct tree_desc t[2];

if (parse_tree(head) || parse_tree(remote))
if (repo_parse_tree(the_repository, head) || repo_parse_tree(the_repository, remote))
return -1;

repo_hold_locked_index(the_repository, &lock_file, LOCK_DIE_ON_ERROR);
Expand Down Expand Up @@ -2038,7 +2038,7 @@ static int merge_tree(struct tree *tree)
struct unpack_trees_options opts;
struct tree_desc t[1];

if (parse_tree(tree))
if (repo_parse_tree(the_repository, tree))
return -1;

repo_hold_locked_index(the_repository, &lock_file, LOCK_DIE_ON_ERROR);
Expand Down Expand Up @@ -2071,11 +2071,11 @@ static int clean_index(const struct object_id *head, const struct object_id *rem
struct tree *head_tree, *remote_tree, *index_tree;
struct object_id index;

head_tree = parse_tree_indirect(head);
head_tree = repo_parse_tree_indirect(the_repository, head);
if (!head_tree)
return error(_("Could not parse object '%s'."), oid_to_hex(head));

remote_tree = parse_tree_indirect(remote);
remote_tree = repo_parse_tree_indirect(the_repository, remote);
if (!remote_tree)
return error(_("Could not parse object '%s'."), oid_to_hex(remote));

Expand All @@ -2089,7 +2089,7 @@ static int clean_index(const struct object_id *head, const struct object_id *rem
0, NULL))
return -1;

index_tree = parse_tree_indirect(&index);
index_tree = repo_parse_tree_indirect(the_repository, &index);
if (!index_tree)
return error(_("Could not parse object '%s'."), oid_to_hex(&index));

Expand Down
12 changes: 7 additions & 5 deletions builtin/checkout.c
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ static int reset_tree(struct tree *tree, const struct checkout_opts *o,
init_checkout_metadata(&opts.meta, info->refname,
info->commit ? &info->commit->object.oid : null_oid(the_hash_algo),
NULL);
if (parse_tree(tree) < 0)
if (repo_parse_tree(the_repository, tree) < 0)
return 128;
init_tree_desc(&tree_desc, &tree->object.oid, tree->buffer, tree->size);
switch (unpack_trees(1, &tree_desc, &opts)) {
Expand Down Expand Up @@ -803,7 +803,8 @@ static int merge_working_tree(const struct checkout_opts *opts,
if (opts->new_orphan_branch && opts->orphan_from_empty_tree) {
if (new_branch_info->commit)
BUG("'switch --orphan' should never accept a commit as starting point");
new_tree = parse_tree_indirect(the_hash_algo->empty_tree);
new_tree = repo_parse_tree_indirect(the_repository,
the_hash_algo->empty_tree);
if (!new_tree)
BUG("unable to read empty tree");
} else {
Expand Down Expand Up @@ -841,14 +842,15 @@ static int merge_working_tree(const struct checkout_opts *opts,
old_commit_oid = old_branch_info->commit ?
&old_branch_info->commit->object.oid :
the_hash_algo->empty_tree;
tree = parse_tree_indirect(old_commit_oid);
tree = repo_parse_tree_indirect(the_repository,
old_commit_oid);
if (!tree)
die(_("unable to parse commit %s"),
oid_to_hex(old_commit_oid));

init_tree_desc(&trees[0], &tree->object.oid,
tree->buffer, tree->size);
if (parse_tree(new_tree) < 0)
if (repo_parse_tree(the_repository, new_tree) < 0)
die(NULL);
tree = new_tree;
init_tree_desc(&trees[1], &tree->object.oid,
Expand Down Expand Up @@ -1278,7 +1280,7 @@ static void setup_new_branch_info_and_source_tree(
new_branch_info->commit = lookup_commit_reference_gently(the_repository, rev, 1);
if (!new_branch_info->commit) {
/* not a commit */
*source_tree = parse_tree_indirect(rev);
*source_tree = repo_parse_tree_indirect(the_repository, rev);
if (!*source_tree)
die(_("unable to read tree (%s)"), oid_to_hex(rev));
} else {
Expand Down
4 changes: 2 additions & 2 deletions builtin/clone.c
Original file line number Diff line number Diff line change
Expand Up @@ -680,10 +680,10 @@ static int checkout(int submodule_progress, int filter_submodules,
opts.dst_index = the_repository->index;
init_checkout_metadata(&opts.meta, head, &oid, NULL);

tree = parse_tree_indirect(&oid);
tree = repo_parse_tree_indirect(the_repository, &oid);
if (!tree)
die(_("unable to parse commit %s"), oid_to_hex(&oid));
if (parse_tree(tree) < 0)
if (repo_parse_tree(the_repository, tree) < 0)
exit(128);
init_tree_desc(&t, &tree->object.oid, tree->buffer, tree->size);
if (unpack_trees(1, &t, &opts) < 0)
Expand Down
5 changes: 3 additions & 2 deletions builtin/commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,11 @@ static void create_base_index(const struct commit *current_head)
opts.dst_index = the_repository->index;

opts.fn = oneway_merge;
tree = parse_tree_indirect(&current_head->object.oid);
tree = repo_parse_tree_indirect(the_repository,
&current_head->object.oid);
if (!tree)
die(_("failed to unpack HEAD tree object"));
if (parse_tree(tree) < 0)
if (repo_parse_tree(the_repository, tree) < 0)
exit(128);
init_tree_desc(&t, &tree->object.oid, tree->buffer, tree->size);
if (unpack_trees(1, &t, &opts))
Expand Down
2 changes: 1 addition & 1 deletion builtin/diff-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ static int stdin_diff_trees(struct tree *tree1, const char *p)
if (!isspace(*p++) || parse_oid_hex(p, &oid, &p) || *p)
return error("Need exactly two trees, separated by a space");
tree2 = lookup_tree(the_repository, &oid);
if (!tree2 || parse_tree(tree2))
if (!tree2 || repo_parse_tree(the_repository, tree2))
return -1;
printf("%s %s\n", oid_to_hex(&tree1->object.oid),
oid_to_hex(&tree2->object.oid));
Expand Down
2 changes: 1 addition & 1 deletion builtin/ls-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ int cmd_ls_tree(int argc,
for (i = 0; i < options.pathspec.nr; i++)
options.pathspec.items[i].nowildcard_len = options.pathspec.items[i].len;
options.pathspec.has_wildcard = 0;
tree = parse_tree_indirect(&oid);
tree = repo_parse_tree_indirect(the_repository, &oid);
if (!tree)
die("not a tree object");
/*
Expand Down
9 changes: 6 additions & 3 deletions builtin/merge-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,17 +447,20 @@ static int real_merge(struct merge_tree_options *o,

if (repo_get_oid_treeish(the_repository, merge_base, &base_oid))
die(_("could not parse as tree '%s'"), merge_base);
base_tree = parse_tree_indirect(&base_oid);
base_tree = repo_parse_tree_indirect(the_repository,
&base_oid);
if (!base_tree)
die(_("unable to read tree (%s)"), oid_to_hex(&base_oid));
if (repo_get_oid_treeish(the_repository, branch1, &head_oid))
die(_("could not parse as tree '%s'"), branch1);
parent1_tree = parse_tree_indirect(&head_oid);
parent1_tree = repo_parse_tree_indirect(the_repository,
&head_oid);
if (!parent1_tree)
die(_("unable to read tree (%s)"), oid_to_hex(&head_oid));
if (repo_get_oid_treeish(the_repository, branch2, &merge_oid))
die(_("could not parse as tree '%s'"), branch2);
parent2_tree = parse_tree_indirect(&merge_oid);
parent2_tree = repo_parse_tree_indirect(the_repository,
&merge_oid);
if (!parent2_tree)
die(_("unable to read tree (%s)"), oid_to_hex(&merge_oid));

Expand Down
8 changes: 4 additions & 4 deletions builtin/merge.c
Original file line number Diff line number Diff line change
Expand Up @@ -756,19 +756,19 @@ static int read_tree_trivial(struct object_id *common, struct object_id *head,
opts.trivial_merges_only = 1;
opts.merge = 1;
opts.preserve_ignored = 0; /* FIXME: !overwrite_ignore */
trees[nr_trees] = parse_tree_indirect(common);
trees[nr_trees] = repo_parse_tree_indirect(the_repository, common);
if (!trees[nr_trees++])
return -1;
trees[nr_trees] = parse_tree_indirect(head);
trees[nr_trees] = repo_parse_tree_indirect(the_repository, head);
if (!trees[nr_trees++])
return -1;
trees[nr_trees] = parse_tree_indirect(one);
trees[nr_trees] = repo_parse_tree_indirect(the_repository, one);
if (!trees[nr_trees++])
return -1;
opts.fn = threeway_merge;
cache_tree_free(&the_repository->index->cache_tree);
for (i = 0; i < nr_trees; i++) {
parse_tree(trees[i]);
repo_parse_tree(the_repository, trees[i]);
init_tree_desc(t+i, &trees[i]->object.oid,
trees[i]->buffer, trees[i]->size);
}
Expand Down
14 changes: 11 additions & 3 deletions builtin/pack-objects.c
Original file line number Diff line number Diff line change
Expand Up @@ -3863,8 +3863,11 @@ static void read_packs_list_from_stdin(struct rev_info *revs)
repo_for_each_pack(the_repository, p) {
const char *pack_name = pack_basename(p);

if ((item = string_list_lookup(&include_packs, pack_name)))
if ((item = string_list_lookup(&include_packs, pack_name))) {
if (exclude_promisor_objects && p->pack_promisor)
die(_("packfile %s is a promisor but --exclude-promisor-objects was given"), p->pack_name);
item->util = p;
}
if ((item = string_list_lookup(&exclude_packs, pack_name)))
item->util = p;
}
Expand Down Expand Up @@ -3942,6 +3945,7 @@ static void read_stdin_packs(enum stdin_packs_mode mode, int rev_list_unpacked)
revs.tree_objects = 1;
revs.tag_objects = 1;
revs.ignore_missing_links = 1;
revs.exclude_promisor_objects = exclude_promisor_objects;

/* avoids adding objects in excluded packs */
ignore_packed_keep_in_core = 1;
Expand Down Expand Up @@ -5098,9 +5102,13 @@ int cmd_pack_objects(int argc,
exclude_promisor_objects_best_effort,
"--exclude-promisor-objects-best-effort");
if (exclude_promisor_objects) {
use_internal_rev_list = 1;
fetch_if_missing = 0;
strvec_push(&rp, "--exclude-promisor-objects");

/* --stdin-packs handles promisor objects separately. */
if (!stdin_packs) {
use_internal_rev_list = 1;
strvec_push(&rp, "--exclude-promisor-objects");
}
} else if (exclude_promisor_objects_best_effort) {
use_internal_rev_list = 1;
fetch_if_missing = 0;
Expand Down
4 changes: 2 additions & 2 deletions builtin/read-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ static int list_tree(struct object_id *oid)

if (nr_trees >= MAX_UNPACK_TREES)
die("I cannot read more than %d trees", MAX_UNPACK_TREES);
tree = parse_tree_indirect(oid);
tree = repo_parse_tree_indirect(the_repository, oid);
if (!tree)
return -1;
trees[nr_trees++] = tree;
Expand Down Expand Up @@ -268,7 +268,7 @@ int cmd_read_tree(int argc,
cache_tree_free(&the_repository->index->cache_tree);
for (i = 0; i < nr_trees; i++) {
struct tree *tree = trees[i];
if (parse_tree(tree) < 0)
if (repo_parse_tree(the_repository, tree) < 0)
return 128;
init_tree_desc(t+i, &tree->object.oid, tree->buffer, tree->size);
}
Expand Down
3 changes: 3 additions & 0 deletions builtin/repack.c
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,9 @@ int cmd_repack(int argc,
!(pack_everything & PACK_CRUFT))
strvec_push(&cmd.args, "--pack-loose-unreachable");
} else if (geometry.split_factor) {
pack_geometry_repack_promisors(repo, &po_args, &geometry,
&names, packtmp);

if (midx_must_contain_cruft)
strvec_push(&cmd.args, "--stdin-packs");
else
Expand Down
4 changes: 2 additions & 2 deletions builtin/reset.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ static int reset_index(const char *ref, const struct object_id *oid, int reset_t
goto out;

if (reset_type == MIXED || reset_type == HARD) {
tree = parse_tree_indirect(oid);
tree = repo_parse_tree_indirect(the_repository, oid);
if (!tree) {
error(_("unable to read tree (%s)"), oid_to_hex(oid));
goto out;
Expand Down Expand Up @@ -417,7 +417,7 @@ int cmd_reset(int argc,
struct tree *tree;
if (repo_get_oid_treeish(the_repository, rev, &oid))
die(_("Failed to resolve '%s' as a valid tree."), rev);
tree = parse_tree_indirect(&oid);
tree = repo_parse_tree_indirect(the_repository, &oid);
if (!tree)
die(_("Could not parse object '%s'."), rev);
oidcpy(&oid, &tree->object.oid);
Expand Down
8 changes: 4 additions & 4 deletions builtin/stash.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,8 @@ static int reset_tree(struct object_id *i_tree, int update, int reset)

memset(&opts, 0, sizeof(opts));

tree = parse_tree_indirect(i_tree);
if (parse_tree(tree))
tree = repo_parse_tree_indirect(the_repository, i_tree);
if (repo_parse_tree(the_repository, tree))
return -1;

init_tree_desc(t, &tree->object.oid, tree->buffer, tree->size);
Expand Down Expand Up @@ -940,8 +940,8 @@ static void diff_include_untracked(const struct stash_info *info, struct diff_op
struct unpack_trees_options unpack_tree_opt = { 0 };

for (size_t i = 0; i < ARRAY_SIZE(oid); i++) {
tree[i] = parse_tree_indirect(oid[i]);
if (parse_tree(tree[i]) < 0)
tree[i] = repo_parse_tree_indirect(the_repository, oid[i]);
if (repo_parse_tree(the_repository, tree[i]) < 0)
die(_("failed to parse tree"));
init_tree_desc(&tree_desc[i], &tree[i]->object.oid,
tree[i]->buffer, tree[i]->size);
Expand Down
2 changes: 1 addition & 1 deletion cache-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,7 @@ static void prime_cache_tree_rec(struct repository *r,
struct cache_tree_sub *sub;
struct tree *subtree = lookup_tree(r, &entry.oid);

if (parse_tree(subtree) < 0)
if (repo_parse_tree(the_repository, subtree) < 0)
exit(128);
sub = cache_tree_sub(it, entry.path);
sub->cache_tree = cache_tree();
Expand Down
Loading