aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-01-24 19:08:49 -0500
committerShawn O. Pearce <spearce@spearce.org>2007-01-25 00:25:31 -0500
commitbb816c5a25e3a87d4d9588ddcccf83b8a10d8d31 (patch)
treed00aa51e9c0cfa187a2c31ea9ff18322eb5acaa1
parentf747133720d26e52b6ed83dfd57cdd1a74668b3d (diff)
downloadgit-bb816c5a25e3a87d4d9588ddcccf83b8a10d8d31.tar.gz
git-bb816c5a25e3a87d4d9588ddcccf83b8a10d8d31.tar.xz
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 <spearce@spearce.org>
-rwxr-xr-xgit-gui.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/git-gui.sh b/git-gui.sh
index 842fccc9f..79f980c47 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -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 .]"
@@ -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}}
} {