From: Justin Tobler Date: Mon, 15 Dec 2025 16:24:55 GMT Subject: Re: [PATCH 5/6] builtin/repo: add disk size info to keyvalue stucture output Message-ID: <3uphps6olbz4qphxmivd7iwiwnfvj6mv7su4i4dhaujixf733i@eqybxhvjsznp> In-Reply-To: On 25/12/15 06:33AM, Patrick Steinhardt wrote: > On Fri, Dec 12, 2025 at 02:40:24PM -0600, Justin Tobler wrote: > > So, I'm not sure we can use git-rev-list(1) in the manner suggested > > above. It looks like user-specified objects are always included in the > > output. When using "HEAD" this means the referenced object will always > > be included regardless of the filter used. In practice, this means > > reported disk-usage when filtering by trees or blobs will likely be > > inflated by objects not specified by the filter. As far as I am aware, > > there is not a way to suppress user-specified objects in git-rev-list(1) > > output. > > There is, you can use "--filter-provided-objects". Perfect! I don't know how I missed that option. XD > > I am somewhat curious if always including user-specified objects in > > git-rev-list(1) output regardless of the specified filter is > > intentional. Looking at git-rev-list(1) --filter documentation: > > > > The form --filter=object:type=(tag|commit|tree|blob) omits all objects > > which are not of the requested type. > > > > doesn't indicate this limitation. From looking at the code in > > list-objects-filter.c:list_objects_filter__filter_object() though, it > > does somewhat seem like this behavior is intentional. > > It is intentional, but I've been bitten by it in the past. Hence I > introduced the above option in 9cf68b27d5 (rev-list: allow filtering of > provided items, 2021-04-19). Good to know. I think I'll submit a small patch today to try to clarify the documentation here a little bit. It might be nice to point out this behavior a bit more explictly in the --filter section. :) -Justin