Re: [PATCH v6 5/9] pack-objects: perform name-hash traversal for unpacked objects
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 23, 2025, 23:08 UTC
- Message-ID
- <xmqqikkm3vki.fsf@gitster.g>
- In-Reply-To
- <6b0149a32d300268d4ad870c7cb6597a95e0410b.1750717921.git.me@ttaylorr.com>
Taylor Blau <me@ttaylorr.com> writes:
Show 5 quoted lines
> Now that the 'rev_info' struct is declared outside of > `read_packs_list_from_stdin()`, we can pass it to > `add_objects_in_unpacked_packs()` and add any loose objects as tips to > the above-mentioned traversal, in theory producing slightly tighter > packs as a result.
So the idea is to pretend any and all loose commits as if they are at the tip of branches? By doing so, we ensure each of the tree and blob objects contained in them has a reasonable path-from-the-root?
Show 10 quoted lines
> @@ -4325,6 +4326,10 @@ static int add_loose_object(const struct object_id *oid, const char *path,
> } else {
> add_object_entry(oid, type, "", 0);
> }
> +
> + if (revs && type == OBJ_COMMIT)
> + add_pending_oid(revs, NULL, oid, 0);
> +
> return 0;
> }OK.