From cbc43e891a8e7ada2c95bd4a2a161facb5156516 Mon Sep 17 00:00:00 2001 From: Robin Jarry Date: Sat, 21 Oct 2023 00:52:45 +0200 Subject: 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 Acked-by: Moritz Poldrack --- .gitignore | 2 ++ CHANGELOG.md | 12 ------------ CONTRIBUTING.md | 16 ++++++++++++---- contrib/release.sh | 20 +++++++++++++++++++- 4 files changed, 33 insertions(+), 17 deletions(-) diff --git a/.gitignore b/.gitignore index 2ce89f33..9d9a732e 100644 --- a/.gitignore +++ b/.gitignore @@ -9,3 +9,5 @@ *.1 *.5 *.7 +/.env +/.changelog.md diff --git a/CHANGELOG.md b/CHANGELOG.md index 54229546..dd8e3259 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,18 +3,6 @@ All notable changes to aerc will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). -## [Unreleased](https://git.sr.ht/~rjarry/aerc/log/master) - -### Added - -- New `flagged` criteria for `:sort` -- New `:send-keys` command to control embedded terminals. -- Account aliases now support fnmatch-style wildcards - -### Fixed - -- `colorize` styles can include wildcards `?` and `*` - ## [0.16.0](https://git.sr.ht/~rjarry/aerc/refs/0.16.0) - 2023-09-27 ### Added diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e06ac010..0ede7657 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,10 +19,6 @@ that you did not break anything. - If applicable, update unit tests. - If adding a new feature, please consider adding new tests. - Do not forget to update the docs. -- If your commit brings visible changes for end-users, add an entry in the - *Unreleased* section of the - [CHANGELOG.md](https://git.sr.ht/~rjarry/aerc/tree/master/item/CHANGELOG.md) - file. - Run the linter using `make lint`. Once you are happy with your work, you can create a commit (or several @@ -47,6 +43,18 @@ commits). Follow these general rules: - If you are fixing a regression introduced by another commit, add a `Fixes:` trailer with the commit id and its title. - When in doubt, follow the format and layout of the recent existing commits. +- If your commit brings visible changes for end-users, add one of the following + trailers with a short and concise description of the change. + + * `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. You can take inspiration from existing entries in + [CHANGELOG.md](https://git.sr.ht/~rjarry/aerc/tree/master/item/CHANGELOG.md). There is a great reference for commit messages in the [Linux kernel documentation](https://www.kernel.org/doc/html/latest/process/submitting-patches.html#describe-your-changes). 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" -- cgit