Skip to content

Commit

Permalink
git-gui: Display the size of the pack directory.
Browse files Browse the repository at this point in the history
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 <spearce@spearce.org>
  • Loading branch information
Shawn O. Pearce committed Jan 25, 2007
1 parent f747133 commit bb816c5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions git-gui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2814,6 +2814,16 @@ proc do_stats {} {
}
close $fd

set packed_sz 0
foreach p [glob -directory [gitdir objects pack] \
-type f \
-nocomplain -- *] {
incr packed_sz [file size $p]
}
if {$packed_sz > 0} {
set stats(size-pack) [expr {$packed_sz / 1024}]
}

set w .stats_view
toplevel $w
wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
Expand All @@ -2839,6 +2849,7 @@ proc do_stats {} {
{size {Disk space used by loose objects} { KiB}}
{in-pack {Number of packed objects}}
{packs {Number of packs}}
{size-pack {Disk space used by packed objects} { KiB}}
{prune-packable {Packed objects waiting for pruning}}
{garbage {Garbage files}}
} {
Expand Down

0 comments on commit bb816c5

Please sign in to comment.