Meta/Announce: use mailmap and tweak wording for maintenance tracks
[alt-git.git] / Announce
blob85435b5f16d9e578dda294593acbd4d150569acd
1 #!/bin/sh
2 # Announcement message skelton
4 tmpbase=/var/tmp/git-announce.$$
5 trap 'rm -f $tmpbase.*' 0
6 branch=${1?branch}
7 previous=${2?previous}
8 commit=${3-"$1"}
10 relname=$(git describe "$commit") &&
11 vername=$(expr "$relname" : 'v\(.*\)') || exit $?
13 git rev-parse --verify "$previous" >/dev/null || exit $?
15 case "$branch" in
16 maint)
17 kind="The latest maintenance release" ;;
18 mainto/* | maint-[0-9]*)
19 kind="A maintenance release" ;;
20 master)
21 kind="The latest feature release" ;;
22 esac
24 case "$vername" in
25 *-rc[0-9]*)
26 rpmroot=testing
27 case "$vername" in
28 *-rc0)
29 kind="An early preview release"
32 kind="A release candidate"
34 esac
35 for_testing=" for testing"
38 for_testing=
39 rpmroot='RPMS/$arch'
41 esac
43 vername=$(echo "$vername" | tr "-" ".")
45 git log --use-mailmap --format='%aN,' "$previous" | sort -u >"$tmpbase.prev"
46 git log --use-mailmap --format='%aN,' "$previous..$commit" | sort -u >"$tmpbase.this"
47 comm -12 "$tmpbase.prev" "$tmpbase.this" >"$tmpbase.old"
48 comm -13 "$tmpbase.prev" "$tmpbase.this" >"$tmpbase.new"
50 all=$(wc -l <"$tmpbase.this")
51 new=$(wc -l <"$tmpbase.new")
52 cnt=$(git rev-list --no-merges "$previous..$commit" | wc -l)
54 cat <<EOF
55 To: git@vger.kernel.org
56 Cc: Linux Kernel <linux-kernel@vger.kernel.org>
57 Bcc: lwn@lwn.net
58 Subject: [ANNOUNCE] Git $relname
60 EOF
63 echo "$kind Git $relname is now available$for_testing at the usual places."
64 if test "$branch" = master
65 then
66 cat <<-EOF
67 It is comprised of $cnt non-merge commits since $previous,
68 contributed by $all people, $new of which are new faces.
69 EOF
71 ) | fmt -68
73 cat <<EOF
75 The tarballs are found at:
77 https://www.kernel.org/pub/software/scm/git/${for_testing:+testing/}
79 EOF
82 cat <<-EOF
83 The following public repositories all have a copy of
84 the '$relname' tag and
85 EOF
86 case "$branch" in
87 maint-* | mainto/*)
88 echo "some of them have"
90 esac
91 echo "the '$branch' branch that the tag points at:"
92 ) | fmt -68
94 cat <<\EOF
96 url = https://kernel.googlesource.com/pub/scm/git/git
97 url = git://repo.or.cz/alt-git.git
98 url = https://code.google.com/p/git-core/
99 url = git://git.sourceforge.jp/gitroot/git-core/git.git
100 url = git://git-core.git.sourceforge.net/gitroot/git-core/git-core
101 url = https://github.com/gitster/git
104 fmt_people () {
105 # Yes, I don't perform well without 2 or more people.
106 # Sue me. The heading says "are as follows" anyway ;-).
107 sed -e '${
108 s/^/and /
109 s/,$/./
110 }' "$1" |
111 fmt -66 |
112 sed -e 's/^/ /'
116 if test "$branch" = master
117 then
118 cat <<-EOF
120 New contributors whose contributions weren't in $previous are as follows.
121 Welcome to the Git development community!
123 $(fmt_people "$tmpbase.new")
125 Returning contributors who helped this release are as follows.
126 Thanks for your continued support.
128 $(fmt_people "$tmpbase.old")
132 cat <<EOF
134 ----------------------------------------------------------------
138 case "$(git ls-tree ${branch} RelNotes)" in
139 120000' '*)
140 RelNotes=$(git cat-file blob "${branch}:RelNotes")
143 RelNotes=RelNotes
145 esac &&
146 git cat-file blob "${branch}:$RelNotes" |
147 case "$relname" in
148 *-*)
149 sed -e 's/^Git .* Release Notes$/& (draft)/' \
150 -e 's/^=============/&========/'
155 esac
157 cat <<EOF
159 ----------------------------------------------------------------
161 Changes since $previous are as follows:
165 git log --no-merges "$previous".."$branch" |
166 git shortlog