X-Git-Url: https://oss.titaniummirror.com/gitweb?p=git-utils.git;a=blobdiff_plain;f=server-gc;fp=server-gc;h=0000000000000000000000000000000000000000;hp=b24ef89f791269a0cd96a11b6064879ecdbcbd3a;hb=1dc41fbf298952bc686347d66d695e0446a1dac4;hpb=2650ac381e7604c5073f7acaff43169ae6bdc1d2 diff --git a/server-gc b/server-gc deleted file mode 100755 index b24ef89..0000000 --- a/server-gc +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh -# -# server-gc -- Run git-gc on each git repository found within the provided -# filesystem directory tree. Useful for shared on-server repos that don't -# automatically do gc operations. This script was first posted at -# http://groups.google.com/group/repo-discuss/web/repository-repacking -# -# NOTE: THIS UTILITY DOES NOT REALLY APPEAR TO BE NEEDED. - -if [ $(whoami) != "root" ]; then - echo "usage: $0 must be ran as root" >&2 - exit 1 -fi - -TOP=$1 -if [ ! -d "$TOP" ]; then - echo "usage: $0 >" >&2 - exit 1 -fi - -cd $TOP -for p in $(find . -type d -name \*.git | sed 's,^./,,') -do - d=$TOP/$p - echo - echo "*** Repository $d ***" - - git --git-dir=$d config repack.usedeltabaseoffset true - git --git-dir=$d config pack.compression 9 - git --git-dir=$d config pack.indexversion 2 - - git --git-dir=$d config gc.autopacklimit 4 - git --git-dir=$d config gc.packrefs true - git --git-dir=$d config gc.reflogexpire never - git --git-dir=$d config gc.reflogexpireunreachable never - - case $p in - kernel/lk.git) - : use defaults - ;; - kernel/*) - git --git-dir=$d config pack.threads 6 - git --git-dir=$d config pack.window 250 - git --git-dir=$d config pack.depth 50 - ;; - esac - - rm -rf $d/logs/refs/changes 2>/dev/null - - git --git-dir=$d gc --auto --aggressive --prune || break - - (find $d/refs/changes -type d | xargs rmdir; - find $d/refs/changes -type d | xargs rmdir - ) 2>/dev/null -done