Skip to content

Commit bb816c5

Browse files
committed
git-gui: Display the size of the pack directory.
Just as we show the amount of disk space taken by the loose objects, its interesting to know how much space is taken by the packs directory. So show that in our Database Statistics dialog. Signed-off-by: Shawn O. Pearce <[email protected]>
1 parent f747133 commit bb816c5

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

git-gui.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2814,6 +2814,16 @@ proc do_stats {} {
28142814
}
28152815
close $fd
28162816

2817+
set packed_sz 0
2818+
foreach p [glob -directory [gitdir objects pack] \
2819+
-type f \
2820+
-nocomplain -- *] {
2821+
incr packed_sz [file size $p]
2822+
}
2823+
if {$packed_sz > 0} {
2824+
set stats(size-pack) [expr {$packed_sz / 1024}]
2825+
}
2826+
28172827
set w .stats_view
28182828
toplevel $w
28192829
wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
@@ -2839,6 +2849,7 @@ proc do_stats {} {
28392849
{size {Disk space used by loose objects} { KiB}}
28402850
{in-pack {Number of packed objects}}
28412851
{packs {Number of packs}}
2852+
{size-pack {Disk space used by packed objects} { KiB}}
28422853
{prune-packable {Packed objects waiting for pruning}}
28432854
{garbage {Garbage files}}
28442855
} {

0 commit comments

Comments
 (0)