make the blobtracker... not a blobtracker any more.
[trackgit.git] / run-all.sh
blobba96b3ddedd45431c1ea2c9dfc52ba373cc54105
1 #!/bin/sh
3 # config
4 GMANE_DROPBOX=~/dl/gmane-git
5 REPO=~/tmp/git
6 TOOLPATH=~/dev/trackgit
8 # download new mails
9 cd "$GMANE_DROPBOX"
10 cur_inbox=$(ls | sort -n | tail -1)
11 cur_gmane_id () {
12 grep '^Archived-At' "$1" | tail -1 | sed 's#.*/\([0-9]\{1,\}\)>$#\1#'
14 begin=$(cur_gmane_id $cur_inbox)
15 boundary=$(($begin+1000))
16 wget -O gmane-$boundary.tmp http://download.gmane.org/gmane.comp.version-control.git/$begin/$boundary
17 end=$(cur_gmane_id gmane-$boundary.tmp)
18 if [ -z "$end" ]; then
19 rm gmane-$boundary.tmp
20 else
21 mv gmane-$boundary.tmp $end
24 # rest _must_ run in git clone
25 cd "$REPO"
27 # update our git.git
28 git fetch origin
30 # import mails
31 if [ -n "$end" ]; then
32 "$TOOLPATH"/mail.py "$GMANE_DROPBOX"/$end
35 # redo notes
36 "$TOOLPATH"/notes.py
38 unwind_noop () {
39 git diff-tree --quiet --exit-code $1^! &&
40 git update-ref refs/heads/$1 $1^
42 unwind_noop notes/full
43 unwind_noop notes/terse
45 # push
46 git push trast notes/terse notes/full