What's in/cooking updates
[git] / WI
1 #!/bin/sh
2 # Prepare "What's in git.git"
3
4 maint_at=$(git rev-parse --verify refs/heads/maint)
5 master_at=$(git rev-parse --verify refs/heads/master)
6 maint_was=$(git rev-parse --verify refs/hold/sa/maint)
7 master_was=$(git rev-parse --verify refs/hold/sa/master)
8
9 log () {
10         git shortlog -w76,2,4 --no-merges "$@"
11 }
12
13 one () {
14         git show -s --pretty="format:%h (%s)" "$1"
15 }
16
17 eval $(LC_ALL=C date +"monthname=%b month=%m year=%Y date=%d dow=%a")
18
19 lead="whats/in/$year/$month"
20 issue=$(
21         cd Meta &&
22         git ls-tree -r --name-only HEAD "$lead"  | tail -n 1
23 )
24 if test -n "$issue"
25 then
26         issue=$( expr "$issue" : '.*/0*\([1-9][0-9]*\)\.txt$' )
27         issue=$(( $issue + 1 ))
28 else
29         issue=1
30 fi
31 issue=$( printf "%02d" $issue )
32
33 mkdir -p "Meta/$lead"
34 exec >"Meta/$lead/$issue.txt"
35
36 cat <<EOF
37 Subject: What's in git.git ($monthname $year, #$issue; $dow, $date)
38 X-maint-at: $maint_at
39 X-master-at: $master_at
40 X-maint-was: $maint_was
41 X-master-was: $master_was
42
43 What's in git.git ($monthname $year, #$issue; $dow, $date)
44
45   maint $(one maint)
46  master $(one master)
47 ------------------------------------------------------------------------
48
49 BLURB HERE
50 EOF
51
52 tagged=`git rev-parse --not --verify hold/sa/maint`
53 list=`git rev-list $tagged refs/heads/maint 2>/dev/null`
54 a=
55 if test -n "$list"
56 then
57         echo
58         echo "* The 'maint' branch has these fixes since the last announcement."
59         echo
60         log $tagged heads/maint
61         a='
62   in addition to the above.'
63 else
64         a=.
65 fi
66
67 tagged=`git rev-parse --not --verify hold/sa/master`
68 list=`git rev-list $tagged refs/heads/master 2>/dev/null`
69 if test -n "$list"
70 then
71         echo
72         echo "* The 'master' branch has these since the last announcement$a"
73         echo
74         log $tagged heads/master ^heads/maint
75 fi