diff options
| author | Justin Tobler <jltobler@gmail.com> | 2025-12-17 11:54:04 -0600 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-12-18 09:02:32 +0900 |
| commit | df1b071fedfddc322fa2a5e0f71d23cb05949d6f (patch) | |
| tree | fb571a9cd500b171adc29d2fb3b2338395d75bf6 /builtin | |
| parent | 67cecc693f511321b9d96eead24fd42e6a5c0cdc (diff) | |
| download | git-df1b071fedfddc322fa2a5e0f71d23cb05949d6f.tar.xz | |
builtin/repo: add object disk size info to structure table
Similar to a prior commit, update the table output format for the
git-repo(1) structure command to display the total object disk usage by
object type.
Signed-off-by: Justin Tobler <jltobler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
| -rw-r--r-- | builtin/repo.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/builtin/repo.c b/builtin/repo.c index 7ea051f3af..09bc8fccfd 100644 --- a/builtin/repo.c +++ b/builtin/repo.c @@ -324,6 +324,7 @@ static void stats_table_setup_structure(struct stats_table *table, struct ref_stats *refs = &stats->refs; size_t inflated_object_total; size_t object_count_total; + size_t disk_object_total; size_t ref_total; ref_total = get_total_reference_count(refs); @@ -358,6 +359,18 @@ static void stats_table_setup_structure(struct stats_table *table, " * %s", _("Blobs")); stats_table_size_addf(table, objects->inflated_sizes.tags, " * %s", _("Tags")); + + disk_object_total = get_total_object_values(&objects->disk_sizes); + stats_table_size_addf(table, disk_object_total, + " * %s", _("Disk size")); + stats_table_size_addf(table, objects->disk_sizes.commits, + " * %s", _("Commits")); + stats_table_size_addf(table, objects->disk_sizes.trees, + " * %s", _("Trees")); + stats_table_size_addf(table, objects->disk_sizes.blobs, + " * %s", _("Blobs")); + stats_table_size_addf(table, objects->disk_sizes.tags, + " * %s", _("Tags")); } static void stats_table_print_structure(const struct stats_table *table) |
