blob: 40c58efe0884a2431146bdd3dd12910033e5f182 [file] [log] [blame]
Junio C Hamano60036a42005-07-30 17:31:47 -07001#!/bin/sh
Junio C Hamanoa4caa522005-11-19 02:54:07 -08002#
3# Copyright (c) 2005 Junio C Hamano
4#
Junio C Hamano60036a42005-07-30 17:31:47 -07005
Junio C Hamano710b7092005-11-27 22:53:20 -08006GIT_DIR=`git-rev-parse --git-dir` || exit $?
Junio C Hamanoa4caa522005-11-19 02:54:07 -08007
8dc </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}
Junio C Hamano60036a42005-07-30 17:31:47 -070022
Junio C Hamanod6a461e2005-10-19 15:01:50 -070023echo $(find "$GIT_DIR/objects"/?? -type f -print 2>/dev/null | wc -l) objects, \
Junio C Hamano60036a42005-07-30 17:31:47 -070024$({
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