Typofix: what's cooking 2008-11 #02
[git/spearce.git] / WC
blobef1bda7518833c3809d382543ee23f136888b873
1 #!/bin/sh
2 # Prepare "What's cooking in git.git"
4 master_at=$(git rev-parse --verify refs/heads/master)
5 next_at=$(git rev-parse --verify refs/heads/next)
7 keep_master=
8 case "$1" in
9 generate)
10 echo Here are the topics that have been
11 echo
12 Meta/git-topic.perl --base=master | sed -e 's/^\*./\n*/'
13 exit
15 keep)
16 keep_master=--keep-master
18 esac
20 eval $(LC_ALL=C date +"monthname=%b month=%m year=%Y date=%d dow=%a")
22 lead="whats/cooking/$year/$month"
23 issue=$(
24 cd Meta &&
25 git ls-tree -r --name-only HEAD "$lead" | tail -n 1
27 if test -n "$issue"
28 then
29 issue=$( expr "$issue" : '.*/0*\([1-9][0-9]*\)\.txt$' )
30 issue=$(( $issue + 1 ))
31 else
32 issue=1
34 issue=$( printf "%02d" $issue )
35 mkdir -p "Meta/$lead"
37 exec >"Meta/$lead/$issue.txt"
39 cat <<EOF
40 Subject: What's cooking in git.git ($monthname $year, #$issue; $dow, $date)
41 X-master-at: $master_at
42 X-next-at: $next_at
44 What's cooking in git.git ($monthname $year, #$issue; $dow, $date)
45 --------------------------------------------------
47 EOF
49 last=$(
50 cd Meta &&
51 git ls-tree -r --name-only HEAD "whats/cooking" | tail -n 1
54 sed -e 's/^\[New Topics\]$/[Old New Topics]/' "Meta/$last" |
55 Meta/UWC $keep_master