pandoc/tools/changelog-helper.sh

31 lines
1.3 KiB
Bash
Raw Normal View History

2018-10-03 07:41:41 +02:00
#!/bin/sh
# generate preliminary list of changes since changelog
# was last modified
2021-02-22 04:02:28 +01:00
lastmod=`git log -n1 --format=oneline changelog.md | awk '{print $1;}'`
files=`git ls-tree -r master --name-only | grep --invert-match '^test\/\|^data\/docx\/\|^data\/odt\/\|^data\/pptx\/\|^citeproc\/\|^data\/translations\/'`
2018-10-03 07:41:41 +02:00
for x in $files
do
2021-02-22 04:02:28 +01:00
echo $x 1>&2
2018-10-03 07:41:41 +02:00
commits=`git log -n1 $lastmod..HEAD $x`
if [ ! -z "$commits" ]
2018-10-03 07:41:41 +02:00
then
if echo $x | grep -q "src\/.*\.hs"
then
file=`echo $x | sed -e 's/src\///' | sed -e 's/\//\./g' | sed -e 's/\.hs$//'`
else
file=$x
fi
echo " * $file"
2021-02-22 04:02:28 +01:00
git log --pretty=format:'%n%w(78,4,6)+ %s (%aN)%n%n%w(78,6,6)%b%n' "$lastmod..HEAD" "$x"
2018-10-03 07:41:41 +02:00
fi
done
2021-02-22 04:02:28 +01:00
echo "test/" 1>&2
git log --pretty=format:'%n%w(78,4,6)+ %s (%aN)%n%n%w(78,6,6)%b%n' "$lastmod..HEAD" test/
git log --pretty=format:'%n%w(78,4,6)+ %s (%aN)%n%n%w(78,6,6)%b%n' "$lastmod..HEAD" data/docx/
git log --pretty=format:'%n%w(78,4,6)+ %s (%aN)%n%n%w(78,6,6)%b%n' "$lastmod..HEAD" data/odt/
git log --pretty=format:'%n%w(78,4,6)+ %s (%aN)%n%n%w(78,6,6)%b%n' "$lastmod..HEAD" data/pptx/
git log --pretty=format:'%n%w(78,4,6)+ %s (%aN)%n%n%w(78,6,6)%b%n' "$lastmod..HEAD" data/translations/
git log --pretty=format:'%n%w(78,4,6)+ %s (%aN)%n%n%w(78,6,6)%b%n' "$lastmod..HEAD" citeproc/
2018-10-03 07:41:41 +02:00