aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/release.sh
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2023-10-21 00:52:45 +0200
committerRobin Jarry <robin@jarry.cc>2023-10-23 16:18:30 +0200
commitcbc43e891a8e7ada2c95bd4a2a161facb5156516 (patch)
tree941c2a5a224912638fac51a02d7f0824fc816019 /contrib/release.sh
parent8c576798d5aa7afdbf0c3f787e3fbbcce0a82c39 (diff)
downloadaerc-cbc43e891a8e7ada2c95bd4a2a161facb5156516.tar.gz
changelog: get unreleased entries from commit trailers
Asking contributors to update the CHANGELOG.md file is causing lots of merge conflicts. Introduce a new workflow where contributors can attach changelog entries in patches via git trailers. Changelog-added: For new features. Changelog-fixed: For bug fixes. Changelog-changed: For behaviour or config format changes. Changelog-deprecated: For deprecation or removal of functionality. If a complete trailer is longer than 72 characters, it can be continued by indenting extra lines with a single space. The trailer text must be valid markdown. Update CONTRIBUTING.md with new guidelines. Update contrib/release.sh to extract these trailers before tagging and create a new section in CHANGELOG.md. Extract unreleased entries in this commit to follow the new workflow. Changelog-added: New `flagged` criteria for `:sort`. Changelog-added: New `:send-keys` command to control embedded terminals. Changelog-added: Account aliases now support fnmatch-style wildcards. Changelog-fixed: `colorize` support for wildcards `?` and `*`. Signed-off-by: Robin Jarry <robin@jarry.cc> Acked-by: Moritz Poldrack <moritz@poldrack.dev>
Diffstat (limited to 'contrib/release.sh')
-rwxr-xr-xcontrib/release.sh20
1 files changed, 19 insertions, 1 deletions
diff --git a/contrib/release.sh b/contrib/release.sh
index e3b3369c..001c68d2 100755
--- a/contrib/release.sh
+++ b/contrib/release.sh
@@ -13,7 +13,25 @@ tag_url="https://git.sr.ht/~rjarry/aerc/refs/$next_tag"
echo "======= Creating release commit..."
sed -i GNUmakefile -e "s/$prev_tag/$next_tag/g"
-sed -i CHANGELOG.md -e "s|^## \[Unreleased\].*|&\n\n## [$next_tag]($tag_url) - $(date +%Y-%m-%d)|"
+make wrap
+{
+ echo
+ echo "## [$next_tag]($tag_url) - $(date +%Y-%m-%d)"
+ for kind in Added Fixed Changed Deprecated; do
+ format="%(trailers:key=Changelog-$kind,unfold,valueonly)"
+ if git log --format="$format" $prev_tag.. | grep -q .; then
+ echo
+ echo "### $kind"
+ echo
+ git log --format="$format" $prev_tag.. | \
+ sed '/^$/d; s/[[:space:]]\+/ /; s/^/- /' | \
+ ./wrap -r
+ fi
+ done
+} > .changelog.md
+sed -i CHANGELOG.md -e '/^The format is based on/ r .changelog.md'
+${EDITOR:-vi} CHANGELOG.md
+rm -f .changelog.md
git add GNUmakefile CHANGELOG.md
git commit -sm "Release version $next_tag"