blob: 2ba0815de7462947adbd8cd5a5e64d5466ac569e [file] [log] [blame]
Andreas Bollc1dcf962012-06-14 08:25:42 -06001#!/bin/bash
Brian Paul51c9c672012-06-14 08:22:54 -06002
3# This script is used to generate the list of changes that
4# appears in the release notes files, with HTML formatting.
Andreas Bollb8e41db2013-04-18 09:32:39 +02005#
6# Usage examples:
7#
8# $ bin/shortlog_mesa.sh mesa-9.0.2..mesa-9.0.3
9# $ bin/shortlog_mesa.sh mesa-9.0.2..mesa-9.0.3 > changes
10# $ bin/shortlog_mesa.sh mesa-9.0.2..mesa-9.0.3 | tee changes
Brian Paul51c9c672012-06-14 08:22:54 -060011
12
13typeset -i in_log=0
14
15git shortlog $* | while read l
16do
17 if [ $in_log -eq 0 ]; then
Andreas Bollc1dcf962012-06-14 08:25:42 -060018 echo '<p>'$l'</p>'
Brian Paul51c9c672012-06-14 08:22:54 -060019 echo '<ul>'
20 in_log=1
21 elif echo "$l" | egrep -q '^$' ; then
Andreas Bollc1dcf962012-06-14 08:25:42 -060022 echo '</ul>'
Brian Paul51c9c672012-06-14 08:22:54 -060023 echo
24 in_log=0
25 else
Andreas Bollc1dcf962012-06-14 08:25:42 -060026 mesg=$(echo $l | sed 's/ (cherry picked from commit [0-9a-f]\+)//;s/\&/&amp;/g;s/</\&lt;/g;s/>/\&gt;/g')
Brian Paul51c9c672012-06-14 08:22:54 -060027 echo ' <li>'${mesg}'</li>'
28 fi
29done