From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.219.52 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796422381; b=JAa6NXghILccePecob+0+EenGXYMiqJdCjEu0+iWLNsff2BA3wN26Wvjjz0iLLf91kMX Xa30PBjUOaOT1CfFQyfMI9TLZ1EoYuhJMaX/qlUjuxU8u8jtDa/0bkrMAsZw3ed/FZKGZ odkBUPfotbi7poSm/I78u5KXzzp7TYhFwdkcDxbV+whGFhN0wZOU/Wp/mVoaD7FzS2Gct bgl/3hr8KSMNQTnni9ebW142p6CijAbZWIQtMLI4g50D6+PIIgJ//m6/baONvujfcrrjM wVzpxBx6yfODfUYx6Xp6BWN9hkk2nZOeFf2GkQWIrTNJxyaV+eDHarcoQB6k8sinK7A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796422381; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:Message-Id:In-Reply-To: References:From:Date:Subject:Fcc:Content-Type: Content-Transfer-Encoding:MIME-Version:To:Cc; bh=gC4Pj07NZY6JGK8YVe1J48zzy1tHzYJQ1HyytnHIWlw=; b=XG+CnaJbJ0go8UY1wwkjNJasMqFoPBF6xBjG3ZrTwdbmtxky9WtVRtj8hRTrN3WXCD7B D+hmp1zqdPGt8+okNjuXXxEjL2msvoizTu0x0iNWJjiVEEIHBxZbSQqz2TED6eaQ66uZ3 jhi6X78V6sS/RQu684ijO5/ythSPiprLl5Mwf92kLALLIIjsAKXg1bwopfzENrze1tf3/ SU12BmVmk22g+QnjvBWAcH1mfwMkOThjyIeQ6JD+hY9/OS7WMHWLWV3ZD4qr6W+BaE64S 1RtGX7piQcItFZiopy7GBbk22Bopgpr8mZrUaWPGUKGKb7eHutHCrXvaJOPoPqKS7xQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=J6zGCgUQ; arc=none smtp.remote-ip=209.85.219.52 Received: from mail-qv1-f52.google.com (mail-qv1-f52.google.com [209.85.219.52]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6CABE606A322 for ; Fri, 4 Dec 2026 22:13:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 6CABE606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=J6zGCgUQ Received: by mail-qv1-f52.google.com with SMTP id 6a1803df08f44-92125687442so15388366d6.2 for ; Fri, 04 Dec 2026 14:13:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796422379; x=1797027179; darn=vger.kernel.org; h=cc:to:mime-version:content-transfer-encoding:content-type:fcc :subject:date:from:references:in-reply-to:message-id:from:to:cc :subject:date:message-id:reply-to:content-type; bh=gC4Pj07NZY6JGK8YVe1J48zzy1tHzYJQ1HyytnHIWlw=; b=J6zGCgUQOVTdxgaFAo01GAUM/MuilSx8pOzIuSLPSNkB+URcFWS/W/EdZU4m8N/EIF mhUCDywi6kCUI8D5d8foOsspUoGtlZKXVOw83vLS9bFMbE283xboCFpMb7O7WcM+HsWP LYE5tdK+pXPqDDwXDy6wXFwoNxNjmeKhGKzK0sGaE/mt9fLuSDukmQl+DxIKIVzx6+un kw5ybSBICy2ZNq869X5GazSzye4zxEfBjUFi3Q9mSmmesixKhT+ZTWaNEJDQ7UEBOnzJ AHl9ccn/edh5yAX+lSgHMBEtSbVfkUzDQMtYx1TqNmeD2YpZsYXmKZYsnP60sXgDczYf aJwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796422379; x=1797027179; h=cc:to:mime-version:content-transfer-encoding:content-type:fcc :subject:date:from:references:in-reply-to:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=gC4Pj07NZY6JGK8YVe1J48zzy1tHzYJQ1HyytnHIWlw=; b=kvMXNzRlNwmRvTRcCY9EdHoDJ+MQ9cR8OdCkKcVvVUnvhVz7ONIuyYiH0S6YLT+kyJ PDvxu5sr0GGzyogFwef/dwqsg2ScKRvrAqelZ26vy1EWQIIwpTyV3v5KCerELvdWD50l aX9LyG/cWKJKfk0bJGul2eNY71yRZfE/pI9JrGXxR6WrACQ5K2++n+C3sJ40a2xIACo9 w4ofvOFlwXB/USfaa2AF9mWm/Mk1qkhyUfkW4T9twi8BfV1G03YrCaFVDv580sWWhU1s rj3Djw1gOznhNbI6F2XoMGbuP5XqfGqJOHGKTSgqRKG9q86IDvHtkx+z0wY0jZIWZiCu ylPA== X-Gm-Message-State: AB4q+uGlIVayGn71yO2q+AE9bgS3kfrxSbEQxPC7rzaEPmGjaHJwIU2l rqx1BBskV9WtDDrRdBisuW3Qb3XhAAJWVzHaG387qs8Wnw0mcpudwsNiu9wPdw== X-Gm-Gg: AZFdTZd66aG6jXEUSPVgC92p0oY+XKB7AFq6QBy82xkW4C239C/QtbEeiHYLSNpxEVN OexNSvKz5iKBw/BA/0+DhYReQSMpS9LbDKXk+vBAFa6ea1D1NEV7/mTUj1EHoLZNTS3Dxf8hFHE 2B1A+TUjjDFGR8leYDfjFW5vD6+DxXTmoafy6hz+crBdHOV3lpvU/5bkLspLPo4e/uKO/S63tP1 90mGR+rSutoT+mjgCAex1ZIW9euv5YtPVnzEoW/shvv746QHWeUJYaOw2dfn4OBKu+d18PQNi7c dmbwTgQeONmSInFkQ51jc5KPtc2Z0q7usSBwyYiPbbEBkenZCPWtLYgYZHTt1S1BoXuMVbjpEId Y/AFxbgKZ6GsOEkTWet9MH0B8D7nt2ba1Ltwfey46sO+Bppgpa8iUwFN6guXCrbkQK++EjWb5BZ T/l0rQcNgChR3hecFJ7k7FA79J1bCW4JO06qVZ9l4tWb7GtouM8hUzKx1jIH32MJ+Gei5C8BkWp mRds8bXtUh2B/peXxiUvfRjaRtTSTEgH6KqDF6cjqffVfRDcyHrBEr47a2RxPu2fJ4U1E/xRRrH JrFj+4xi09RVMJ3yUP0j09iol7VQ9kI4 X-Received: by 2002:a05:6214:2589:b0:921:74a1:7e1e with SMTP id 6a1803df08f44-921e24612afmr55531316d6.31.1796422379115; Fri, 04 Dec 2026 14:12:59 -0800 (PST) Received: from [127.0.0.1] ([4.246.135.196]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-921e05b6264sm31944126d6.43.2026.12.04.14.12.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2026 14:12:58 -0800 (PST) Message-Id: In-Reply-To: References: From: "Derrick Stolee via GitGitGadget" Date: Fri, 04 Dec 2026 22:12:57 +0000 Subject: [PATCH v2] delta-islands: revisit trees with new delta marks Fcc: Sent Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Mailing-List: git@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 To: git@vger.kernel.org Cc: gitster@pobox.com, peff@peff.net, ttaylorr@openai.com, newren@gmail.com, Derrick Stolee , Derrick Stolee From: Derrick Stolee Delta islands group objects into "reachability categories" and help to choose delta bases using those categories. The idea is that if an object is in a certain set of categories, then its dela base should also be in at least that set (potentially more). For example, a category could be "reachable from the refs in a fork" in an environment where multiple forks share an object database but distinct ref namespaces. Another example could be to isolate a trunk ref from the rest of the reachable set to preserve deltas during --single-branch clones of the trunk. A description of this motivation can be found at [1]. [1] https://blog.github.com/open-source/git/counting-objects/#the-performance-fix This change fixes an issue where these categories could be incorrectly computed and thus can violate the intended goal of delta islands. This was made more visible with the --path-walk integration, but existed before then. When exploring the object graph to group objects into delta-islands, some trees and blobs can be visited from one path and then revisited later from another. If those two visits come from objects with different delta marks, then the final mark of the visited object should be the union of those marks. Instead, some cases only have the first marks as we don't reprocess objects marked with SEEN. This gets worse for objects recursively reachable from that object. This change includes some test cases that demonstrate this problem, and several of the modes fail without the accompanying code change. These examples were discovered while working with the --path-walk option as integrated with delta islands in 7e6de2ac628 (pack-objects: support `--delta-islands` with `--path-walk`, 2026-06-21), but that option only exposed an existing failure within the marking algorithm. At least one of the new tests exposes a failure without --path-walk. The issue is not just about different path names, but about appearing at paths of different depth. For example, a tree appearing at a/b/ can be visited with one set of marks as supplied from the trees at a/ while later being seen at x/y/z/ with different marks supplied by objects at x/y/. To fix this issue, we need to potentially reprocess a tree and everything it can reach when we discover an update to the delta island marks. This can lead to massive recomputation with certain data shapes that revisit objects from different paths. This seems unlikely to happen often in realistic scenarios, but is unavoidable without topologically sorting the entire object graph before distributing marks. Concretely, update set_island_marks() to report whether the object gained any bits in the process. Use a depth-priority queue to revisit trees that have new marks. We need to be careful to avoid adding duplicates to the queue without replicating the SEEN bit. This depth heuristic is only to prioritize a breadth-first-search, handling root trees before the next set of trees, and so on. This is intended to maximize the possibility of seeing all links to an object before visiting that object. The first-seen-depth problem was identified during the original delta-island review [2]: SEEN prevents revisiting shared trees, so their recorded depths need not give a topological ordering. That discussion illustrated missed delta opportunities. Incomplete marks can also allow unwanted cross-island deltas, as acknowledged for a related root-depth bug in 3949053617 (pack-objects: fix off-by-one in delta-island tree-depth computation, 2018-11-20) [3]. Later discussion emphasized real fork-network results and the difficulty of constructing focused corner-case tests [4]. [2] https://lore.kernel.org/git/20180727130229.GB18599@sigill.intra.peff.net/ [3] https://lore.kernel.org/git/20181120095053.GC22742@sigill.intra.peff.net/ [4] https://lore.kernel.org/git/20181120113423.GA29319@sigill.intra.peff.net/ Using p5305's historical-fork island selection, with --no-path-walk, bitmap reads disabled, --window=0, --compression=0, and stored deltas reusable, gives these old-to-fixed command times and tree visits: Time (s) Tree visits git/git 8.08 -> 8.24 162,791 -> 162,795 nodejs/node 9.85 -> 10.14 238,723 -> 239,837 microsoft/fluentui 4.13 -> 4.24 287,056 -> 287,136 torvalds/linux 176.28 -> 170.73 6,888,020 -> 6,888,085 It's possible that a true integration of delta islands with path-walk would help here, having the path-walk API compute the delta island marks as we traverse objects in path-based groups. Such an implementation would need to allow for objects to be readded to groups when their delta marks are updated while avoiding multiple emissions of the object from the API. Such a large rework of the delta island computation is avoided for now, as we can reproduce the error with the existing implementation. Since we may revisit an object more than once, our progress indicators can no longer use a percentage approach and still make sense. Thus, we drop the denominator and only list an increasing count. Assisted-by: GPT-6.1 Sol Signed-off-by: Derrick Stolee --- delta-islands: revisit trees with new delta marks Discovered while working on a real application of delta islands and the --path-walk feature. Updates in V2 ============= * Fixed sign-off to match committer/author and .mailmap email. * Updated motivation for delta islands to start of commit message. * Mentioned change in progress indicators in commit message. * Added doc comment to set_island_marks(). Published-As: https://github.com/gitgitgadget/git/releases/tag/pr-2343%2Fderrickstolee%2Fdelta-islands-v2 Fetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-2343/derrickstolee/delta-islands-v2 Pull-Request: https://github.com/gitgitgadget/git/pull/2343 Range-diff vs v1: 1: 80605f6844 ! 1: 22ef9e3f6d delta-islands: revisit trees with new delta marks @@ Metadata ## Commit message ## delta-islands: revisit trees with new delta marks + Delta islands group objects into "reachability categories" and help to + choose delta bases using those categories. The idea is that if an object + is in a certain set of categories, then its dela base should also be in + at least that set (potentially more). For example, a category could be + "reachable from the refs in a fork" in an environment where multiple + forks share an object database but distinct ref namespaces. Another + example could be to isolate a trunk ref from the rest of the reachable + set to preserve deltas during --single-branch clones of the trunk. + + A description of this motivation can be found at [1]. + + [1] https://blog.github.com/open-source/git/counting-objects/#the-performance-fix + + This change fixes an issue where these categories could be incorrectly + computed and thus can violate the intended goal of delta islands. This + was made more visible with the --path-walk integration, but existed + before then. + When exploring the object graph to group objects into delta-islands, some trees and blobs can be visited from one path and then revisited later from another. If those two visits come from objects with different @@ Commit message visiting that object. The first-seen-depth problem was identified during the original - delta-island review [1]: SEEN prevents revisiting shared trees, so their + delta-island review [2]: SEEN prevents revisiting shared trees, so their recorded depths need not give a topological ordering. That discussion illustrated missed delta opportunities. Incomplete marks can also allow unwanted cross-island deltas, as acknowledged for a related root-depth bug in 3949053617 (pack-objects: fix off-by-one in delta-island - tree-depth computation, 2018-11-20) [2]. Later discussion emphasized + tree-depth computation, 2018-11-20) [3]. Later discussion emphasized real fork-network results and the difficulty of constructing focused - corner-case tests [3]. + corner-case tests [4]. - [1] https://lore.kernel.org/git/20180727130229.GB18599@sigill.intra.peff.net/ - [2] https://lore.kernel.org/git/20181120095053.GC22742@sigill.intra.peff.net/ - [3] https://lore.kernel.org/git/20181120113423.GA29319@sigill.intra.peff.net/ + [2] https://lore.kernel.org/git/20180727130229.GB18599@sigill.intra.peff.net/ + [3] https://lore.kernel.org/git/20181120095053.GC22742@sigill.intra.peff.net/ + [4] https://lore.kernel.org/git/20181120113423.GA29319@sigill.intra.peff.net/ Using p5305's historical-fork island selection, with --no-path-walk, bitmap reads disabled, --window=0, --compression=0, and stored deltas @@ Commit message the API. Such a large rework of the delta island computation is avoided for now, as we can reproduce the error with the existing implementation. + Since we may revisit an object more than once, our progress indicators + can no longer use a percentage approach and still make sense. Thus, we + drop the denominator and only list an increasing count. + Assisted-by: GPT-6.1 Sol - Signed-off-by: Derrick Stolee + Signed-off-by: Derrick Stolee ## delta-islands.c ## @@ @@ delta-islands.c: static struct island_bitmap *create_or_get_island_marks(struct } -static void set_island_marks(struct object *obj, struct island_bitmap *marks) ++/* ++ * Given an object and a set of marks, update the island marks on that object ++ * to be the union of the existing marks and these new marks. Returns 1 if ++ * the mark set changes in this process. ++ */ +static int set_island_marks(struct object *obj, struct island_bitmap *marks) { struct island_bitmap *b; delta-islands.c | 68 +++++++++++++++++++++--------- t/t5320-delta-islands.sh | 91 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 139 insertions(+), 20 deletions(-) diff --git a/delta-islands.c b/delta-islands.c index c1c0f992f5..dfd3b0ab7e 100644 --- a/delta-islands.c +++ b/delta-islands.c @@ -10,6 +10,7 @@ #include "pack.h" #include "tree-walk.h" #include "diff.h" +#include "prio-queue.h" #include "progress.h" #include "refs.h" #include "khash.h" @@ -158,7 +159,12 @@ static struct island_bitmap *create_or_get_island_marks(struct object *obj) return kh_value(island_marks, pos); } -static void set_island_marks(struct object *obj, struct island_bitmap *marks) +/* + * Given an object and a set of marks, update the island marks on that object + * to be the union of the existing marks and these new marks. Returns 1 if + * the mark set changes in this process. + */ +static int set_island_marks(struct object *obj, struct island_bitmap *marks) { struct island_bitmap *b; khiter_t pos; @@ -172,19 +178,23 @@ static void set_island_marks(struct object *obj, struct island_bitmap *marks) */ marks->refcount++; kh_value(island_marks, pos) = marks; - return; + return 1; } + b = kh_value(island_marks, pos); + if (island_bitmap_is_subset(marks, b)) + return 0; + /* * We do have it. Make sure we split any copy-on-write before * updating. */ - b = kh_value(island_marks, pos); if (b->refcount > 1) { b->refcount--; b = kh_value(island_marks, pos) = island_bitmap_new(b); } island_bitmap_or(b, marks); + return 1; } static void mark_remote_island_1(struct repository *r, @@ -226,9 +236,10 @@ static void mark_remote_island_1(struct repository *r, struct tree_islands_todo { struct object_entry *entry; unsigned int depth; + unsigned queued:1; }; -static int tree_depth_compare(const void *a, const void *b) +static int tree_depth_compare(const void *a, const void *b, void *data UNUSED) { const struct tree_islands_todo *todo_a = a; const struct tree_islands_todo *todo_b = b; @@ -242,40 +253,44 @@ void resolve_tree_islands(struct repository *r, { struct progress *progress_state = NULL; struct tree_islands_todo *todo; - int nr = 0; - int i; + struct tree_islands_todo *current; + struct prio_queue queue = { .compare = tree_depth_compare }; + uint64_t processed = 0; + uint32_t i; if (!island_marks) return; /* * We process only trees, as commits and tags have already been handled - * (and passed their marks on to root trees, as well. We must make sure - * to process them in descending tree-depth order so that marks - * propagate down the tree properly, even if a sub-tree is found in - * multiple parent trees. + * (and passed their marks on to root trees, as well). Prefer shallower + * trees, but the first-seen depth can place a shared tree before + * another parent. Requeue trees whose marks change after processing. */ ALLOC_ARRAY(todo, to_pack->nr_objects); for (i = 0; i < to_pack->nr_objects; i++) { if (oe_type(&to_pack->objects[i]) == OBJ_TREE) { - todo[nr].entry = &to_pack->objects[i]; - todo[nr].depth = oe_tree_depth(to_pack, &to_pack->objects[i]); - nr++; + todo[i].entry = &to_pack->objects[i]; + todo[i].depth = oe_tree_depth(to_pack, &to_pack->objects[i]); + todo[i].queued = 1; + prio_queue_put(&queue, &todo[i]); } } - QSORT(todo, nr, tree_depth_compare); if (progress) - progress_state = start_progress(r, _("Propagating island marks"), nr); + progress_state = start_progress(r, _("Propagating island marks"), 0); - for (i = 0; i < nr; i++) { - struct object_entry *ent = todo[i].entry; + while ((current = prio_queue_get(&queue))) { + struct object_entry *ent = current->entry; struct island_bitmap *root_marks; struct tree *tree; struct tree_desc desc; struct name_entry entry; khiter_t pos; + current->queued = 0; + display_progress(progress_state, ++processed); + pos = kh_get_oid_map(island_marks, ent->idx.oid); if (pos >= kh_end(island_marks)) continue; @@ -289,6 +304,8 @@ void resolve_tree_islands(struct repository *r, init_tree_desc(&desc, &tree->object.oid, tree->buffer, tree->size); while (tree_entry(&desc, &entry)) { struct object *obj; + struct object_entry *child; + struct tree_islands_todo *child_todo; if (S_ISGITLINK(entry.mode)) continue; @@ -297,15 +314,26 @@ void resolve_tree_islands(struct repository *r, if (!obj) continue; - set_island_marks(obj, root_marks); + if (!set_island_marks(obj, root_marks) || + !S_ISDIR(entry.mode)) + continue; + + child = packlist_find(to_pack, &entry.oid); + if (!child || oe_type(child) != OBJ_TREE) + continue; + + child_todo = &todo[child - to_pack->objects]; + if (!child_todo->queued) { + child_todo->queued = 1; + prio_queue_put(&queue, child_todo); + } } free_tree_buffer(tree); - - display_progress(progress_state, i+1); } stop_progress(&progress_state); + clear_prio_queue(&queue); free(todo); } diff --git a/t/t5320-delta-islands.sh b/t/t5320-delta-islands.sh index 9b28344a0a..e8544cdfe3 100755 --- a/t/t5320-delta-islands.sh +++ b/t/t5320-delta-islands.sh @@ -170,4 +170,95 @@ test_expect_success 'unmatched island core is not fatal' ' git -c "pack.islandcore=one" repack -adfi ' +for order in deep-newer shallow-newer +do + test_expect_success "setup shared subtree ($order)" ' + git init "shared-subtree-$order" && + ( + cd "shared-subtree-$order" && + shared=$({ test-tool genrandom seed 10240 && echo 1; } | + git hash-object -w --stdin) && + private=$({ test-tool genrandom seed 10240 && echo 12; } | + git hash-object -w --stdin) && + nested=$({ test-tool genrandom nested 10240 && echo 1; } | + git hash-object -w --stdin) && + private_nested=$({ test-tool genrandom nested 10240 && echo 12; } | + git hash-object -w --stdin) && + leaf=$(printf "100644 blob %s\tfile\n" "$nested" | + git mktree) && + subtree=$(printf "040000 tree %s\tchild\n100644 blob %s\tfile\n" \ + "$leaf" "$shared" | git mktree) && + root_one=$({ + printf "040000 tree %s\ta\n" "$subtree" && + printf "100644 blob %s\tprivate\n" "$private" && + printf "100644 blob %s\tprivate-nested\n" "$private_nested" + } | git mktree) && + inner=$(printf "040000 tree %s\tc\n" "$subtree" | + git mktree) && + middle=$(printf "040000 tree %s\tb\n" "$inner" | + git mktree) && + root_two=$(printf "040000 tree %s\tz\n" "$middle" | + git mktree) && + test_tick && + one=$(echo one | git commit-tree "$root_one") && + test_tick && + two=$(echo two | git commit-tree "$root_two") && + if test "$order" = shallow-newer + then + test_tick && + one=$(echo one | git commit-tree "$root_one") + fi && + git update-ref refs/heads/one "$one" && + git update-ref refs/heads/two "$two" + ) + ' + + for traversal in --no-path-walk --path-walk + do + for bitmap in --no-write-bitmap-index --write-bitmap-index + do + test_expect_success "islands respect shared subtree ($order, $traversal, $bitmap)" ' + ( + cd "shared-subtree-$order" && + shared=$(git rev-parse one:a/file) && + nested=$(git rev-parse one:a/child/file) && + : >trace && + GIT_TRACE2_EVENT="$(pwd)/trace" \ + git -c "pack.island=refs/heads/(.*)" \ + repack -adfi "$bitmap" "$traversal" 2>err && + test_grep ! "failed to pack objects via path-walk" err && + if test "$traversal" = --path-walk + then + test_region pack-objects path-walk trace + fi && + is_delta_base "$shared" "$ZERO_OID" && + is_delta_base "$nested" "$ZERO_OID" + ) + ' + done + + test_expect_success "island core orders shared subtree ($order, $traversal)" ' + ( + cd "shared-subtree-$order" && + shared=$(git rev-parse one:a/file) && + private=$(git rev-parse one:private) && + : >trace && + GIT_TRACE2_EVENT="$(pwd)/trace" \ + git -c "pack.island=refs/heads/(.*)" \ + -c pack.islandCore=two repack -adfi "$traversal" 2>err && + test_grep ! "failed to pack objects via path-walk" err && + if test "$traversal" = --path-walk + then + test_region pack-objects path-walk trace + fi && + printf "%s\n" "$shared" "$private" >expect && + git verify-pack -v .git/objects/pack/*.pack >pack && + cut -d" " -f1 pack | + grep -E "^($shared|$private)$" >actual && + test_cmp expect actual + ) + ' + done +done + test_done base-commit: 7fb6055e678f800320d8ab8cd8f201d9493d1ba0 -- gitgitgadget