1
0
Fork 0

Ignore ChangeLogs in NEWS

* tools/gitlog-to-news: Account for ChangeLog entries in commit messages.
master
Mike Gerwitz 2017-10-29 00:07:50 -04:00
parent 6c6e41c415
commit 05bb844f12
Signed by: mikegerwitz
GPG Key ID: 8C917B7F5DC51BA2
1 changed files with 15 additions and 2 deletions

View File

@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# Formats and concatenates long commit messages
#
# Copyright (C) 2012, 2013 Free Software Foundation, Inc.
@ -24,5 +24,18 @@ git log --log-size --format="%H%n%B" \
| grep -A1 '^log size \([5-9][0-9]\{2,\}\|[0-9]\{4,\}\)$' \
| grep -o '^[a-z0-9]\+$' \
| grep -vFf "${1:-/dev/null}" \
| xargs -n1 git log -n1 --date=rfc --no-notes \
| while read id; do
# try to account for ChangeLogs in commits
text=$(
git log -n1 --date=rfc --no-notes "$id" \
| awk '/^ \* /{ exit } { print }'
)
# remember that four (or five, if merge) of these lines are the header
# (including empty line)
len=$( wc -l <<< "$text" )
test "$len" -gt 10 || continue
echo "$text"
done \
| awk '/^commit/ && NR!=1 { printf "\n\n" } { print }'