datatracker/bin/commitlog
Robert Sparks ac38f328cf Updated changelog. Tweaked commitlog script.
- Legacy-Id: 19008
2021-05-19 18:12:45 +00:00

34 lines
1.5 KiB
Bash
Executable file

#!/bin/bash
cur=$(svn info | awk '/^Revision:/ { print $2 }')
# List recent commits, extract revision numbers, stop at release, and grab the last revision
# - get svn log, looking backwards from HEAD
# - stop on 'Set version info ...'
# - filter out revision lines
# - grab the first field
# - grab the last line
# - remove the leading 'r'
rev=$(svn log $PWD -r ${2:-HEAD}:${1:-$((cur-100))} \
| sed -r -n -e '1,/^Set version info( and settings)?( back)? to (development|release)/p' \
| egrep '^r[0-9]+ \|' \
| cut -d ' ' -f 1 \
| tail -n 1 \
| sed 's/^r//')
# Grab commit log lines from just after the start rev, going forwards, and reformat
# - Get svn log entries, starting with the earliest
# - Filter out dividing lines and revision/committer/date lines, keeping the messages
# - Insert leading asterisks: ' * ' at the front of the first line in each text block
# - Unwrap lines that start with unindented text
# - Do line folding at column 76
# - Indent any unindented lines 4 spaces
# - Add blank lines in front of log entries
svn log $PWD -r $((rev+2)):${2:-HEAD} \
| sed -r 's/^(----------|r[0-9]+).*$/\n/' \
| sed '1,/./s/^/ * /;/^$/,/./s/^/ * /;/^ \* $/d' \
| sed -e :a -e '$!N;s/\n([A-Za-z0-9])/ \\1/;ta' -e 'P;D' \
| fold -sw76 \
| sed -r 's/^([^ ].*)$/ &/' \
| sed -r 's/^ \* /\n * /'
echo ""
TZ=UTC date +" -- Robert Sparks <rjsparks@nostrum.com> %d %b %Y %H:%M:%S %z"