jobs/gc.sh: repo -> proj (consistency with update.sh)
[girocco/susan.git] / jobs / gc.sh
blob5cfa521c688e0ba0e45006142d393a190afd75d9
1 #!/bin/bash
3 . @basedir@/shlib.sh
5 set -e
7 proj="$1"
8 cd "$cfg_reporoot/$proj.git"
10 progress "+ `date` $proj"
12 # safe pruning: we put all our objects to all forks, then we can
13 # safely get rid of extra ones; repacks in forks will get rid of
14 # the redundant ones again then
15 forkdir="$1"
16 if [ -d "$forkdir" ]; then
17 get_repo_list "$forkdir/" |
18 while read fork; do
19 # Match objects in parent project
20 for d in objects/?? objects/pack; do
21 [ "$d" != "objects/??" ] || continue
22 mkdir -p "$cfg_reporoot/$forkdir/$fork.git/$d"
23 ln -f "$d"/* "$cfg_reporoot/$forkdir/$fork.git/$d"
24 done
25 done
28 git repack -A -d --window-memory=3G -l -q
29 git prune
30 git update-server-info
31 date -R >.last_gc
33 progress "- `date` $proj"