Ensure a stable view column search
[tig.git] / tools / announcement.sh
blobc9fdc5cf71b93f187d2920b8ee5efea9a3b28aa4
1 #!/bin/sh
3 # Prepare the content of the next tig release announcement.
4 # Usage: $0 [revision]
6 # Copyright (c) 2008-2014 Jonas Fonseca <jonas.fonseca@gmail.com>
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.
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.
18 root="$(git rev-parse --show-cdup)"
19 NEWS="${root}NEWS.adoc"
20 README="${root}README.adoc"
21 from="$(sed -n '7,/^tig-/p' < "$NEWS" | tail -n 1 | cut -d' ' -f 1)"
22 to="${1-HEAD}"
23 short=
25 test -n "$(git rev-list --skip=50 $from..$to)" && short=-s
27 cat <<EOF
28 $to
29 $(echo "$to" | sed 's/[0-9a-zA-Z.-]/=/g')
31 *** text for the announcement ***
33 $(sed -n '/What is tig?/,/^$/p' < "$README")
35 $(sed -n 's/\( -.*\)[[(].*/\1/p' < "$README")
37 Release notes
38 -------------
39 $(sed -n '7,/^tig-/p' < "$NEWS" | sed '/^tig-/d')
41 Change summary
42 --------------
43 The diffstat and log summary for changes made in this release.
45 $(git diff-tree -M --stat=72 $from..$to)
47 $(git shortlog --no-merges $short $from..$to)
48 EOF