Subject: Re: [PATCH v3 3/6] builtin/repo: collect largest inflated objects

From: Patrick Steinhardt <[email-masked]>
Date: Tue, 3 Mar 2026 14:27:22 +0100

On Mon, Mar 02, 2026 at 03:45:23PM -0600, Justin Tobler wrote:
> diff --git a/builtin/repo.c b/builtin/repo.c
> index 782194cf4c..59d5cb2551 100644
> --- a/builtin/repo.c
> +++ b/builtin/repo.c
> @@ -453,6 +482,14 @@ static inline void print_keyvalue(const char *key, char key_delim, size_t value,
>  	       value_delim);
>  }
>  
> +static void print_object_data(const char *key, char key_delim,
> +			      struct object_data *data, char value_delim)
> +{
> +	print_keyvalue(key, key_delim, data->value, value_delim);
> +	printf("%s_oid%c%s%c", key, key_delim, oid_to_hex(&data->oid),
> +	       value_delim);
> +}
> +
>  static void structure_keyvalue_print(struct repo_structure *stats,
>  				     char key_delim, char value_delim)
>  {

And this helper is also quite a welcome improvement.

> @@ -492,6 +529,15 @@ static void structure_keyvalue_print(struct repo_structure *stats,
>  	print_keyvalue("objects.tags.disk_size", key_delim,
>  		       stats->objects.disk_sizes.tags, value_delim);
>  
> +	print_object_data("objects.commits.max_size", key_delim,
> +			  &stats->objects.largest.commit_size, value_delim);
> +	print_object_data("objects.trees.max_size", key_delim,
> +			  &stats->objects.largest.tree_size, value_delim);
> +	print_object_data("objects.blobs.max_size", key_delim,
> +			  &stats->objects.largest.blob_size, value_delim);
> +	print_object_data("objects.tags.max_size", key_delim,
> +			  &stats->objects.largest.tag_size, value_delim);
> +
>  	fflush(stdout);
>  }

Certainly makes this part easier to verify.

Patrick