savannah-hackers-public
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Savannah-hackers-public] git usage


From: Karl Berry
Subject: [Savannah-hackers-public] git usage
Date: Sat, 4 Aug 2012 22:24:59 GMT

ttn,

Savannah now has a monthly cron job that does some git maintenance on
all repos (thanks to Jim Meyering).  Does this suffice for your needs?

kb

vcs# cat /root/infra/git-gc-all-repos
[...]

date; echo 'running du w/cold cache takes a while...'; du -sh .
for dir in $(find . -type d -maxdepth 2 -name '*.git'|sort); do
  echo $dir... 1>&2
  start_kb=$(du -sk $dir|cut -f1)
  printf '%-20s %u KiB->' $dir $start_kb
  start_sec=$(date +%s)
  git --git-dir=$dir gc -q
  end_sec=$(date +%s)
  elapsed=$((end_sec - start_sec))
  end_kb=$(du -sk $dir|cut -f1)
  percent_saved=$(echo "scale=2; 100 * ($start_kb - $end_kb) / $start_kb"|bc)
  printf '%s (saved %s%% in %ss)\n' $end_kb $percent_saved $elapsed
done
date; du -sh .



reply via email to

[Prev in Thread] Current Thread [Next in Thread]