Subject: Re: [PATCH v2 2/5] builtin/repo: collect largest inflated objects

From: Justin Tobler <[email-masked]>
Date: Mon, 2 Mar 2026 11:38:16 -0600

On 26/02/28 08:36PM, Lucas Seiki Oshiro wrote:
> 
> > struct repo_structure {
> > @@ -371,6 +385,21 @@ static void stats_table_setup_structure(struct stats_table *table,
> >      "    * %s", _("Blobs"));
> > stats_table_size_addf(table, objects->disk_sizes.tags,
> >      "    * %s", _("Tags"));
> > +
> > + stats_table_addf(table, "");
> > + stats_table_addf(table, "* %s", _("Largest objects"));
> > + stats_table_addf(table, "  * %s", _("Commits"));
> > + stats_table_size_addf(table, objects->largest.commit_size.value,
> > +      "    * %s", _("Maximum size"));
> 
> I don't know if it's the best place to comment this, but it would be
> nice if we could find the commit that introduced the largest change,
> in terms of size or number of lines.
> 
> This would be useful for people who are asking "what's the largest
> commmit?" thinking about the introduced changes (like what we see in
> GitLab's interface) instead of the size of the commit object, which
> generally is proportional to the message size + the number of
> parents.

I assume by largest change we are referring to finding the commit that
has the most lines changed between it and its parent. This could be
interesting, but I suspect it could be quite costly to compute for large
repositories with many commits. This type of information is not actually
stored in the repository and would have to be computed on the fly. Since
this information is not really part of the repository structure, it
might not be a great fit for this command either. I'm not quite sure
about this one.

Thanks,
-Justin