From a0a78b1af3de76748d8a9b6849fe5a155ff214ea Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Thu, 29 Jan 2015 06:00:44 -0800 Subject: [PATCH] gc.sh: include size of packed-refs in reposizek Previously this was excluded as being insignificant. However, the repository would be unusable without a list of heads and their references, so include the size of the packed-refs file along with the size of the .pack file. This total should be the same size as a `git bundle create foo --all` file would be. In the case of repositories with 26000 (or more) refs such as often occurs with Gerrit repositories, the packed-refs file can actually be more than a megabyte in size, so not actually an insignificant amount. --- jobd/gc.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jobd/gc.sh b/jobd/gc.sh index cc19e54..1ab43cf 100755 --- a/jobd/gc.sh +++ b/jobd/gc.sh @@ -324,7 +324,9 @@ rm -f objects/pack/pack-*.bndl git repack $packopts -a -d -l $quiet allpacks="$(echo objects/pack/pack-$octet20.pack)" curhead="$(cat HEAD)" -eval "reposizek=$(( $(echo 0 $(du -k $allpacks 2>/dev/null | awk '{print $1}') | \ +pkrf= +[ ! -e packed-refs ] || pkrf=packed-refs +eval "reposizek=$(( $(echo 0 $(du -k $pkrf $allpacks 2>/dev/null | awk '{print $1}') | \ sed -e 's/ / + /g') ))" git prune git update-server-info -- 2.11.4.GIT