-
Notifications
You must be signed in to change notification settings - Fork 12
/
genlog
executable file
·40 lines (36 loc) · 1.22 KB
/
genlog
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/sh
EXCLUDE=" * Match window and terminal background colours"
prev=HEAD
use_grep=1
# Merge x.y.0 entries with their subsequent release
all=`git tag | grep '^[0-9]' | sort -r`
first=`for i in $all; do echo $i; done | head -n 1`
rest=`for i in $all; do echo $i; done | tail -n +2 | grep -v '\.0$'`
if echo "$first" | grep -q '\.0$' ; then
first=`echo $rest | sed 's/ .*//'`
rest=`echo $rest | sed 's/^[^ ]* //'`
fi
for i in $first $rest; do
[ "$prev" = "2.3.1" ] && use_grep=0
if [ -n "`git log $i..$prev`" ] ; then
printf "Version "
if [ "$prev" = "HEAD" ] ; then
git describe --match '[0-9]*' | sed 's/-/./;s/-/~/'
else
echo $prev
fi
# Need echo because if there's only one commit head strips trailing \n
(git log '--pretty=format:Author: %an <%ae>%nDate: %aD' $i..$prev ; \
echo ) | head -n 2
if [ $use_grep = 1 ] ; then
git log '--pretty=format:%s' --grep='^\*' \
$i..$prev | sed "s/^\*/ */; s/[:.]$//; /$EXCLUDE/d"
else
git log '--pretty=format:%s' $i..$prev | sed 's/^/ * /; s/[:.]$//'
fi
echo
echo
fi
prev=$i
done
cat `dirname $0`/ChangeLog.old