Re: [PATCH v5 13/15] bugreport: add packed object summary
- From
Emily Shaffer <emilyshaffer@google.com>
- Date
- Feb 5, 2020, 03:15 UTC
- Message-ID
- <20200205031524.GQ87163@google.com>
- In-Reply-To
- <xmqq8sli89eu.fsf@gitster-ct.c.googlers.com>
On Tue, Feb 04, 2020 at 11:00:41AM -0800, Junio C Hamano wrote:
Show 23 quoted lines
> emilyshaffer@google.com writes: > > > From: Emily Shaffer <emilyshaffer@google.com> > > > > Alongside the loose object counts, it can be useful to show the number > > of packs and packed objects. This way we can check whether the repo has > > an appropriate ratio of packed to loose objects to help determine > > whether it's behaving correctly. > > This lets the enumeration machinery to enumerate at the individual > object level, relies on the enumeration machinery to show your > callback all objects from the same pack before an object from a > different pack, to count both objects and packs. > > But given that packfiles record how many objects there are in the > pack, and that the packfile.c layer must know what are the pack > files we have available, I wonder if we have an API already to allow > us to enumerate each packfile, and while counting the number of > times our callback was called, add the objects contained in each of > them. If there isn't, it does not sound like a bad API function to > add (i.e. given a repository r, iterate over r->objects->packed_git > and let the API caller see each of them; the API caller can grab > num_objects and add them up).
Yeah, I don't see one. I'll go ahead and add it - that sounds straightforward enough.
- Emily