mirror of
https://github.com/radareorg/radare2.git
synced 2024-12-05 20:17:43 +00:00
Add sys/release-notes.sh and define commit message conventions ##rules (#11827)
This commit is contained in:
parent
647a6fa439
commit
0a699f60e1
63
sys/release-notes.sh
Executable file
63
sys/release-notes.sh
Executable file
@ -0,0 +1,63 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# This script parses the commit messages between the last 2 git tags
|
||||
# if the last commit contains the word "Release", otherwise it shows
|
||||
# all the changes between the last tag and HEAD.
|
||||
#
|
||||
# Commits are grouped in different sections specified in the commit
|
||||
# message with the middle-dot character '·'. The section names are
|
||||
# arbitrary and we may be careful to use them properly but having
|
||||
# in mind that this may change.
|
||||
#
|
||||
# Commits without any middle·dot in the message are discarted and
|
||||
# displayed in the "to review" section.
|
||||
#
|
||||
# The tool prints Markdown, no plans to support other formats.
|
||||
#
|
||||
# --pancake
|
||||
|
||||
if [ -n "`git log -n 1 | grep Release`" ]; then
|
||||
VERS=`git tag --sort=committerdate | tail -n 1`
|
||||
PREV=`git tag --sort=committerdate | tail -n 2 | head -n1`
|
||||
else
|
||||
VERS=HEAD
|
||||
PREV=`git tag --sort=committerdate | tail -n 1`
|
||||
fi
|
||||
|
||||
git log ${PREV}..${VERS} > .l
|
||||
cat .l | grep ^Author | cut -d : -f 2- | sort -u > .A
|
||||
|
||||
echo "Release Notes"
|
||||
echo "-------------"
|
||||
echo
|
||||
echo "Version: ${VERS}"
|
||||
echo "From: ${PREV}"
|
||||
echo "To: ${VERS}"
|
||||
printf "Commits: "
|
||||
cat .l |grep ^commit |wc -l |xargs echo
|
||||
echo "Contributors: `wc -l .A | awk '{print $1}'`"
|
||||
echo
|
||||
echo "Authors"
|
||||
echo "-------"
|
||||
echo
|
||||
cat .A | perl -ne 'print "*$_"'
|
||||
# | xargs echo '*'
|
||||
echo
|
||||
|
||||
echo "Changes"
|
||||
echo "-------"
|
||||
echo
|
||||
cat .l | grep -v ^commit | grep -v ^Author | grep -v ^Date > .x
|
||||
cat .x | grep '##' | perl -ne '/##(.*)/; if ($1) {print "$1\n";}' | sort -u > .y
|
||||
for a in `cat .y` ; do
|
||||
echo "**$a**"
|
||||
echo
|
||||
cat .x | grep "##$a" | sed -e 's/##.*//g' | xargs echo "*"
|
||||
echo
|
||||
done
|
||||
echo "To Review"
|
||||
echo "---------"
|
||||
cat .x | grep -v '##' | sed -e 's,\t,,' -e 's,^ *,,g' | grep -v "^$" | \
|
||||
perl -ne 'if (/\*/) { print "$_"; } else { print "* $_";}'
|
||||
echo
|
||||
rm -f .x .y .l .A
|
Loading…
Reference in New Issue
Block a user