Re: [PATCH 1/7] loose: drop unused `repo_write_loose_object_map()`
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Oct 20, 2026, 08:49 UTC
- Message-ID
- <atcrJ2u9F_9M9wTl@pks.im>
- In-Reply-To
- <CAOLa=ZT91C0OZE=h7B0j6mgPhfrGjkRN4bCT9gVEXdXx+bSi1A@mail.gmail.com>
On Mon, Oct 19, 2026 at 01:21:08PM -0700, Karthik Nayak wrote:
Show 20 quoted lines
> Patrick Steinhardt <ps@pks.im> writes: > > > The function `repo_write_loose_object_map()` was introduced in > > 23b2c7e95b (loose: add a mapping between SHA-1 and SHA-256 for loose > > objects, 2023-10-01), but it never had any callers as loose object maps > > are instead written incrementally via `repo_add_loose_object_map()` > > whenever a new loose object is created. > > > > Besides being dead code, the function also hardcodes the location of the > > "loose-object-idx" file as "$GIT_COMMON_DIR/objects", whereas both the > > reader and `repo_add_loose_object_map()` derive the location from the > > loose source's path. The function would thus disagree with everyone else > > where the loose object map is supposed to be located when the object > > directory is using a non-default location. > > > > Remove the function. > > > > It's like the function being unused is an insufficient argument by > itself, so we also talk about why its incorrect. Made me chuckle.
Yeah. The only reason that I even stumbled over this function is that it'll break with the object storage format extension, because it would put files into the wrong location. I only realized later on that the function isn't even used at all. But that probably explains why this message is a bit on the excessive side.
Should I trim it?
Patrick