Re: [PATCH 2/4] pack-objects: ensure tree/tag closure with '--stdin-packs=follow'
- From
Derrick Stolee <stolee@gmail.com>
- Date
- Sep 30, 2026, 18:16 UTC
- Message-ID
- <a78a38ca-b08a-4194-b17c-b8802e4d43a7@gmail.com>
- In-Reply-To
- <6348667e2e3fe63aeb139888e877dd8447570253.1790731662.git.me@ttaylorr.com>
On 9/29/2026 9:28 PM, Taylor Blau wrote:
Show 7 quoted lines
> Add trees and tags from included and '!' packs (and loose ones with > '--unpacked') as roots in '--stdin-packs=follow' mode. This rescues > their descendants even when no input commit reaches them. Walk these > roots after the existing traversal, preserving the `SEEN` bit to avoid > redundant traversals. Ensure that the walk takes place *after* the > existing traversal so that we don't lose the path prefix used for trees > and blobs wherever possible.
Show 5 quoted lines
> @@ -3807,6 +3807,7 @@ static int stdin_packs_hints_nr;
> struct stdin_packs_context {
> struct rev_info *revs;
> enum stdin_packs_mode mode;
> + struct oid_array extra_roots;I believe this should be an oidset to avoid adding duplicate objects that appear multiple times. The order of these extra roots doesn't matter (such as in a --topo-order walk). We only care about the binary "reachable or not?" question.
Thanks, -Stolee