@matheusbsbs / matheus-bagliano / commits / 468eb79ed4
Fork 0

builtin-count-objects: make it official.

Remove the shell-script version, make the hardlink from the git binary, and update the documentation to describe a new option. Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed May 1, 2006 at 23:05 UTC 468eb79ed453017151c1230057986a7a79264395
3 files changed +14 -34
Documentation/git-count-objects.txt
+11 -1
@@ -7,13 +7,23 @@ git-count-objects - Reports on unpacked objects
7
8 SYNOPSIS
9 --------
10 -'git-count-objects'
10 +'git-count-objects' [-v]
11
12 DESCRIPTION
13 -----------
14 This counts the number of unpacked object files and disk space consumed by
15 them, to help you decide when it is a good time to repack.
16
17 +
18 +OPTIONS
19 +-------
20 +-v::
21 + In addition to the number of loose objects and disk
22 + space consumed, it reports the number of in-pack
23 + objects, and number of objects that can be removed by
24 + running `git-prune-packed`.
25 +
26 +
27 Author
28 ------
29 Written by Junio C Hamano <junkio@cox.net>
Makefile
+3 -2
@@ -115,7 +115,7 @@ SPARSE_FLAGS = -D__BIG_ENDIAN__ -D__powerpc__
115 SCRIPT_SH = \
116 git-add.sh git-bisect.sh git-branch.sh git-checkout.sh \
117 git-cherry.sh git-clean.sh git-clone.sh git-commit.sh \
118 - git-count-objects.sh git-diff.sh git-fetch.sh \
118 + git-diff.sh git-fetch.sh \
119 git-format-patch.sh git-ls-remote.sh \
120 git-merge-one-file.sh git-parse-remote.sh \
121 git-prune.sh git-pull.sh git-push.sh git-rebase.sh \
@@ -167,7 +167,8 @@ PROGRAMS = \
167 git-name-rev$X git-pack-redundant$X git-repo-config$X git-var$X \
168 git-describe$X git-merge-tree$X git-blame$X git-imap-send$X
169
170 -BUILT_INS = git-log$X
170 +BUILT_INS = git-log$X \
171 + git-count-objects$X
172
173 # what 'all' will build and 'install' will install, in gitexecdir
174 ALL_PROGRAMS = $(PROGRAMS) $(SIMPLE_PROGRAMS) $(SCRIPTS)
git-count-objects.sh deleted
-31
@@ -1,31 +0,0 @@
1 -#!/bin/sh
2 -#
3 -# Copyright (c) 2005 Junio C Hamano
4 -#
5 -
6 -GIT_DIR=`git-rev-parse --git-dir` || exit $?
7 -
8 -dc </dev/null 2>/dev/null || {
9 - # This is not a real DC at all -- it just knows how
10 - # this script feeds DC and does the computation itself.
11 - dc () {
12 - while read a b
13 - do
14 - case $a,$b in
15 - 0,) acc=0 ;;
16 - *,+) acc=$(($acc + $a)) ;;
17 - p,) echo "$acc" ;;
18 - esac
19 - done
20 - }
21 -}
22 -
23 -echo $(find "$GIT_DIR/objects"/?? -type f -print 2>/dev/null | wc -l) objects, \
24 -$({
25 - echo 0
26 - # "no-such" is to help Darwin folks by not using xargs -r.
27 - find "$GIT_DIR/objects"/?? -type f -print 2>/dev/null |
28 - xargs du -k "$GIT_DIR/objects/no-such" 2>/dev/null |
29 - sed -e 's/[ ].*/ +/'
30 - echo p
31 -} | dc) kilobytes