aboutsummaryrefslogtreecommitdiff
path: root/git-count-objects.sh
diff options
context:
space:
mode:
Diffstat (limited to 'git-count-objects.sh')
-rwxr-xr-xgit-count-objects.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/git-count-objects.sh b/git-count-objects.sh
new file mode 100755
index 000000000..74ee4f371
--- /dev/null
+++ b/git-count-objects.sh
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+. git-sh-setup
+
+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