]> git.ipfire.org Git - thirdparty/git.git/blame - WC
What's cooking (2023/08 #04)
[thirdparty/git.git] / WC
CommitLineData
58fab02a
JH
1#!/bin/sh
2# Prepare "What's cooking in git.git"
3
4master_at=$(git rev-parse --verify refs/heads/master)
5next_at=$(git rev-parse --verify refs/heads/next)
6
55dd4b0b 7keep_master=
67d7e9cf
JH
8case "$1" in
9generate)
10 echo Here are the topics that have been
11 echo
12 Meta/git-topic.perl --base=master | sed -e 's/^\*./\n*/'
13 exit
14 ;;
55dd4b0b
JH
15keep)
16 keep_master=--keep-master
17 ;;
67d7e9cf
JH
18esac
19
20eval $(LC_ALL=C date +"monthname=%b month=%m year=%Y date=%d dow=%a")
21
22lead="whats/cooking/$year/$month"
23issue=$(
24 cd Meta &&
25 git ls-tree -r --name-only HEAD "$lead" | tail -n 1
26)
27if test -n "$issue"
28then
29 issue=$( expr "$issue" : '.*/0*\([1-9][0-9]*\)\.txt$' )
30 issue=$(( $issue + 1 ))
31else
32 issue=1
33fi
34issue=$( printf "%02d" $issue )
35mkdir -p "Meta/$lead"
36
37exec >"Meta/$lead/$issue.txt"
32e72b6e
JH
38
39cat <<EOF
8b2fe5f4 40To: git@vger.kernel.org
67d7e9cf 41Subject: What's cooking in git.git ($monthname $year, #$issue; $dow, $date)
32e72b6e
JH
42X-master-at: $master_at
43X-next-at: $next_at
44
67d7e9cf
JH
45What's cooking in git.git ($monthname $year, #$issue; $dow, $date)
46--------------------------------------------------
32e72b6e
JH
47
48EOF
58fab02a 49
67d7e9cf
JH
50last=$(
51 cd Meta &&
52 git ls-tree -r --name-only HEAD "whats/cooking" | tail -n 1
53)
f4d2f0c2
JH
54
55sed -e 's/^\[New Topics\]$/[Old New Topics]/' "Meta/$last" |
55dd4b0b 56Meta/UWC $keep_master