From 60036a41e1f25ee3e89142fa92e203dbbc6145cc Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sat, 30 Jul 2005 17:31:47 -0700 Subject: Add a stupid "count objects" script. This counts the number of unpacked object files and disk space consumed by them, to help you decide when it is a good time to repack. Signed-off-by: Junio C Hamano --- git-count-objects-script | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 git-count-objects-script (limited to 'git-count-objects-script') diff --git a/git-count-objects-script b/git-count-objects-script new file mode 100755 index 0000000000..86432db6aa --- /dev/null +++ b/git-count-objects-script @@ -0,0 +1,13 @@ +#!/bin/sh + +. git-sh-setup-script + +echo $(find "$GIT_DIR/objects"/?? -type f -print | wc -l) objects, \ +$({ + echo 0 + # "no-such" is to help Darwin folks by not using xargs -r. + find "$GIT_DIR/objects"/?? -type f -print 2>/dev/null | + xargs du -k "$GIT_DIR/objects/no-such" 2>/dev/null | + sed -e 's/[ ].*/ +/' + echo p +} | dc) kilobytes -- cgit v1.2.3