Merge https://github.com/luolimao/cclive into next
[cclive.git] / gen-news.sh
blobcd03200b366a7325b613a196e36a73aac20bf39c
1 #!/bin/sh
3 # cclive
4 # Copyright (C) 2012 Toni Gundogdu <legatvs@gmail.com>
6 # This file is part of cclive <http://cclive.sourceforge.net/>.
8 # This program is free software: you can redistribute it and/or modify
9 # it under the terms of the GNU Affero General Public License as
10 # published by the Free Software Foundation, either version 3 of the
11 # License, or (at your option) any later version.
13 # This program is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 # Affero General Public License for more details.
18 # You should have received a copy of the GNU Affero General Public
19 # License along with this program. If not, see
20 # <http://www.gnu.org/licenses/>.
22 set -e
23 IFS=$'
25 v=`./gen-ver.sh`
26 b="$v [`date +%F`]
29 t=`git describe --abbrev=0`
30 for a in `git log --no-merges --format='%an' "$t"..HEAD | sort | uniq`; do
31 c=`git log --no-merges --format=" - %s [%h]" --author="$a" "$t"..HEAD | sort -h`
32 b="$b$a:
35 done
36 b="$b
37 `git diff --shortstat "$t"..HEAD`
40 n=`cat NEWS`
41 F=NEWS
42 echo "$b" >"$F" ; echo "$n" >>"$F"