Meta/MaintNotes: Git Rev News special
[alt-git.git] / Announce
blob487e633e7ff9731326f3be00bb02f59b7509f64a
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 --format='%aN,' "$previous" | sort -u >"$tmpbase.prev"
46 git log --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
62 fmt -68 <<EOF
63 $kind Git $relname is now available$for_testing at the usual places.
64 It is comprised of $cnt non-merge commits since $previous,
65 contributed by $all people, $new of which are new faces.
66 EOF
68 cat <<EOF
70 The tarballs are found at:
72 https://www.kernel.org/pub/software/scm/git/${for_testing:+testing/}
74 The following public repositories all have a copy of the '$relname'
75 tag and the '$branch' branch that the tag points at:
77 url = https://kernel.googlesource.com/pub/scm/git/git
78 url = git://repo.or.cz/alt-git.git
79 url = https://code.google.com/p/git-core/
80 url = git://git.sourceforge.jp/gitroot/git-core/git.git
81 url = git://git-core.git.sourceforge.net/gitroot/git-core/git-core
82 url = https://github.com/gitster/git
83 EOF
85 fmt_people () {
86 # Yes, I don't perform well without 2 or more people.
87 # Sue me. The heading says "are as follows" anyway ;-).
88 sed -e '${
89 s/^/and /
90 s/,$/./
91 }' "$1" |
92 fmt -66 |
93 sed -e 's/^/ /'
97 cat <<EOF
99 New contributors whose contributions weren't in $previous are as follows.
100 Welcome to the Git development community!
102 $(fmt_people "$tmpbase.new")
104 Returning contributors who helped this release are as follows.
105 Thanks for your continued support.
107 $(fmt_people "$tmpbase.old")
109 ----------------------------------------------------------------
113 case "$(git ls-tree ${branch} RelNotes)" in
114 120000' '*)
115 RelNotes=$(git cat-file blob "${branch}:RelNotes")
118 RelNotes=RelNotes
120 esac &&
121 git cat-file blob "${branch}:$RelNotes" |
122 case "$relname" in
123 *-*)
124 sed -e 's/^Git .* Release Notes$/& (draft)/' \
125 -e 's/^=============/&========/'
130 esac
132 cat <<EOF
134 ----------------------------------------------------------------
136 Changes since $previous are as follows:
140 git log --no-merges "$previous".."$branch" |
141 git shortlog