@matheusbsbs / matheus-bagliano / commits / bb816c5a25
Fork 0

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>

Shawn O. Pearce committed Jan 24, 2007 at 19:08 UTC bb816c5a25e3a87d4d9588ddcccf83b8a10d8d31
1 file changed +11
git-gui.sh
+11
@@ -2814,6 +2814,16 @@ proc do_stats {} {
2814 }
2815 close $fd
2816
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 +
2827 set w .stats_view
2828 toplevel $w
2829 wm geometry $w "+[winfo rootx .]+[winfo rooty .]"
@@ -2839,6 +2849,7 @@ proc do_stats {} {
2849 {size {Disk space used by loose objects} { KiB}}
2850 {in-pack {Number of packed objects}}
2851 {packs {Number of packs}}
2852 + {size-pack {Disk space used by packed objects} { KiB}}
2853 {prune-packable {Packed objects waiting for pruning}}
2854 {garbage {Garbage files}}
2855 } {