From ed117d61959cc414951856f2c8215f7937aab649 Mon Sep 17 00:00:00 2001 From: Jan Date: Mon, 13 May 2024 09:46:03 +0200 Subject: [PATCH] update: Guidlines and test script for git commit based release notes --- documentation-guidelines.md | 8 +++--- resources/scripts/release-notes.bash | 39 +++++++++++++++++++++++----- 2 files changed, 38 insertions(+), 9 deletions(-) diff --git a/documentation-guidelines.md b/documentation-guidelines.md index 1131fb1..ada584d 100644 --- a/documentation-guidelines.md +++ b/documentation-guidelines.md @@ -7,9 +7,11 @@ Best practices and guidelines for writing code documentation. The idea is to get rather automated release notes. To have this as easy as possible, we need: - key words for the kind of change we applied: - - `feature:` - for newly added functionality - - `fix:` - for bugfixes - - `nonotes:` - for git commits we don't want to see in the release notes + - `new:` - for newly added functionality + - `update:` - for updated functionality + - `fix:` - for fixed functionality + - `delete:` - for removed functionality + - Everything else will be ignored - tags for each version, we will output only the change log from the last and second last tag - you can add tags with `git tag -a -m ""` diff --git a/resources/scripts/release-notes.bash b/resources/scripts/release-notes.bash index 3174fc0..abf8a37 100644 --- a/resources/scripts/release-notes.bash +++ b/resources/scripts/release-notes.bash @@ -29,13 +29,40 @@ echo "" echo "Release Notes from $secondLastTag to $latestTag:" echo "" -# Separate features and fixes -features=$(git log "$secondLastTag".."$latestTag" --pretty=format:"%s" | grep 'feature:' | sed 's/feature:/* /g' | sort | uniq) -fixes=$(git log "$secondLastTag".."$latestTag" --pretty=format:"%s" | grep 'fix:' | sed 's/fix:/* /g' | sort | uniq) +# Separate types of commits +newfeatures=$(git log "$secondLastTag".."$latestTag" --pretty=format:"%s" | grep 'new:' | sed 's/new:/* /g' | sort | uniq) +updatedfeatures=$(git log "$secondLastTag".."$latestTag" --pretty=format:"%s" | grep 'update:' | sed 's/update:/* /g' | sort | uniq) +fixedfeatures=$(git log "$secondLastTag".."$latestTag" --pretty=format:"%s" | grep 'fix:' | sed 's/fix:/* /g' | sort | uniq) +deletedfeatures=$(git log "$secondLastTag".."$latestTag" --pretty=format:"%s" | grep 'delete:' | sed 's/delete:/* /g' | sort | uniq) echo "New Features:" -echo "$features" +if [ -z "$newfeatures" ]; then + echo "* No new features." +else + echo "$newfeatures" +fi echo "" -echo "Fixes:" -echo "$fixes" + +echo "Updated Features:" +if [ -z "$updatedfeatures" ]; then + echo "* No updated features." +else + echo "$updatedfeatures" +fi +echo "" + +echo "Fixed Features:" +if [ -z "$fixedfeatures" ]; then + echo "* No fixed features." +else + echo "$fixedfeatures" +fi +echo "" + +echo "Deleted Features:" +if [ -z "$deletedfeatures" ]; then + echo "* No deleted features." +else + echo "$deletedfeatures" +fi echo ""