Add script for preparing release announcements
[tig] / contrib / announcement.sh
1 #!/bin/sh
2 #
3 # Prepare the content of the next tig release announcement.
4 # Usage: $0 [revision]
5 #
6 # Copyright (c) 2008 Jonas Fonseca <fonseca@diku.dk>
7 #
8 # This program is free software; you can redistribute it and/or
9 # modify it under the terms of the GNU General Public License as
10 # published by the Free Software Foundation; either version 2 of
11 # the License, or (at your option) any later version.
12 #
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 # GNU General Public License for more details.
17
18 root="$(git rev-parse --show-cdup)"
19 NEWS="${root}NEWS"
20 SITES="${root}SITES"
21 from="$(sed -n '7,/^tig-/p' < "$NEWS" | tail -n 1 | cut -d' ' -f 1)"
22 to="${1-HEAD}"
23
24 cat <<EOF
25 $to
26 $(echo "$to" | sed 's/[0-9a-zA-Z.-]/=/g')
27
28 *** text for the announcement ***
29
30 What is tig?
31 ------------
32 Tig is an ncurses-based text-mode interface for git. It functions mainly
33 as a git repository browser, but can also assist in staging changes for
34 commit at chunk level and act as a pager for output from various git
35 commands.
36
37 $(sed -n '/-/p' < "$SITES" | sed 's/[[(].*//')
38
39 Release notes
40 -------------
41 $(sed -n '7,/^tig-/p' < "$NEWS" | sed '/^tig-/d')
42
43 Change summary
44 --------------
45 The diffstat and shortlog summary for changes made in this release.
46
47 $(git shortlog -s $from..$to)
48
49 $(git diff-tree --stat=72 $from..$to)
50 EOF