|
1 | 1 | #!/bin/bash |
2 | | -# -*- indent-with-tabs: 1 -*- |
3 | | -date |
4 | 2 | cur=$(svn info | awk '/^Revision:/ { print $2 }') |
5 | | -svn log $PWD -r ${2:-HEAD}:${1:-$((cur-100))} \ |
| 3 | +# List recent commits, extract revision numbers, stop at release, and grab the last revision |
| 4 | +# - get svn log, looking backwards from HEAD |
| 5 | +# - stop on 'Set version info ...' |
| 6 | +# - filter out revision lines |
| 7 | +# - grab the first field |
| 8 | +# - grab the last line |
| 9 | +# - remove the leading 'r' |
| 10 | +rev=$(svn log $PWD -r ${2:-HEAD}:${1:-$((cur-100))} \ |
| 11 | + | sed -r -n -e '1,/^Set version info( and settings)?( back)? to (development|release)/p' \ |
| 12 | + | egrep '^r[0-9]+ \|' \ |
| 13 | + | cut -d ' ' -f 1 \ |
| 14 | + | tail -n 1 \ |
| 15 | + | sed 's/^r//') |
| 16 | + |
| 17 | +# Grab commit log lines from just after the start rev, going forwards, and reformat |
| 18 | +# - Get svn log entries, starting with the earliest |
| 19 | +# - Filter out dividing lines and revision/committer/date lines, keeping the messages |
| 20 | +# - Insert leading asterisks: ' * ' at the front of the first line in each text block |
| 21 | +# - Unwrap lines that start with unindented text |
| 22 | +# - Do line folding at column 76 |
| 23 | +# - Indent any unindented lines 4 spaces |
| 24 | +# - Add blank lines in front of log entries |
| 25 | +svn log $PWD -r $((rev+2)):${2:-HEAD} \ |
6 | 26 | | sed -r 's/^(----------|r[0-9]+).*$/\n/' \ |
7 | | - | sed '/./,/^$/!d' \ |
8 | 27 | | sed '1,/./s/^/ * /;/^$/,/./s/^/ * /;/^ \* $/d' \ |
9 | 28 | | sed -e :a -e '$!N;s/\n([A-Za-z0-9])/ \\1/;ta' -e 'P;D' \ |
10 | | - | head -n -1 \ |
11 | | - | fold -sw1000 \ |
12 | | - | tac \ |
13 | 29 | | fold -sw76 \ |
14 | 30 | | sed -r 's/^([^ ].*)$/ &/' \ |
15 | 31 | | sed -r 's/^ \* /\n * /' |
|
0 commit comments