1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-07 11:36:15 +02:00

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 <junkio@cox.net>
This commit is contained in:
Junio C Hamano 2005-07-30 17:31:47 -07:00
parent 96155e55e1
commit 60036a41e1
2 changed files with 15 additions and 0 deletions

View File

@ -67,6 +67,8 @@ SCRIPTS=git git-apply-patch-script git-merge-one-file-script git-prune-script \
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 \

13
git-count-objects-script Executable file
View File

@ -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