summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 96155e5)
raw | patch | inline | side by side (parent: 96155e5)
author | Junio C Hamano <junkio@cox.net> | |
Sun, 31 Jul 2005 00:31:47 +0000 (17:31 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 31 Jul 2005 18:58:43 +0000 (11:58 -0700) |
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 <junkio@cox.net>
consumed by them, to help you decide when it is a good time to
repack.
Signed-off-by: Junio C Hamano <junkio@cox.net>
Makefile | patch | blob | history | |
git-count-objects-script | [new file with mode: 0755] | patch | blob |
diff --git a/Makefile b/Makefile
index db52a852f6c7911ebcacaf77bee4ff6f4106b92c..1b0ebb4ce8abce524fe7272b4419c731c126daa3 100644 (file)
--- a/Makefile
+++ b/Makefile
git-ls-remote-script git-clone-dumb-http git-rename-script \
git-request-pull-script git-bisect-script git-fetch-dumb-http
+SCRIPTS += git-count-objects-script
+
PROG= git-update-cache git-diff-files git-init-db git-write-tree \
git-read-tree git-commit-tree git-cat-file git-fsck-cache \
git-checkout-cache git-diff-tree git-rev-tree git-ls-files \
diff --git a/git-count-objects-script b/git-count-objects-script
--- /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