From: Kyle J. McKay Date: Sat, 12 Apr 2014 00:02:17 +0000 (-0700) Subject: gc.sh: optimize darcs repositories X-Git-Url: https://repo.or.cz/w/girocco.git/commitdiff_plain/9aa9ac481687a1fd54d08a32c1ebbe04fc112526 gc.sh: optimize darcs repositories When running gc on a mirror that is a darcs: source, also optimize the .darcs repository to help reduce its footprint. --- diff --git a/jobd/gc.sh b/jobd/gc.sh index 5a3c0b6..ddedf30 100755 --- a/jobd/gc.sh +++ b/jobd/gc.sh @@ -118,6 +118,7 @@ git prune git update-server-info # darcs:// mirrors have a xxx.log file that will grow endlessly # if this is a mirror and the file exists, shorten it to 10000 lines +# also take this opportunity to optimize the darcs repo if [ ! -e .nofetch ]; then url="$(config_get baseurl || :)" case "$url" in darcs://*) @@ -127,6 +128,13 @@ if [ ! -e .nofetch ]; then tail -n 10000 "$basedarcs.log" > "$basedarcs.log.$$" mv -f "$basedarcs.log.$$" "$basedarcs.log" fi + if [ -d "$basedarcs.darcs" ]; then + ( + cd "$basedarcs.darcs" + # Note that this does not optimize _darcs/inventories/ :( + darcs optimize + ) + fi esac fi config_set lastgc "$(date "$datefmt")"