diff options
-rw-r--r-- | CONTRIBUTING.md | 28 | ||||
-rwxr-xr-x | contrib/check-patches | 27 |
2 files changed, 55 insertions, 0 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6c9df2c7..756cd1bb 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -57,6 +57,34 @@ commits). Follow these general rules: 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). +- The following trailers are accepted in commits. If you are using multiple + trailers in a commit, it's preferred to also order them according to this + list. Note, that the `commit-msg` hook (see below for installing) will + automatically sort them for you when committing. + + * `Closes: <URL>` closes the ticket with the neutral `CLOSED` resolution. + * `Fixes: <URL>` closes the ticket with the `FIXED` resolution. + * `Fixes: <sha> ("<title>")` reference the commit that introduced a regression. + * `Implements: <URL>` closes the ticket with the `IMPLEMENTED` resolution. + * `References: <URL>` adds a comment to the ticket. + * `Link:` + * `Changelog-added:` + * `Changelog-fixed:` + * `Changelog-changed:` + * `Changelog-deprecated:` + * `Cc:` + * `Suggested-by:` + * `Requested-by:` + * `Reported-by:` + * `Co-authored-by:` + * `Signed-off-by:` compulsory! + * `Tested-by:` used in review _after_ submission to the mailing list. If + minimal changes occur between respins, feel free to include that into your + respin to keep track of previous reviews. + * `Reviewed-by:` used in review _after_ submission. If minimal changes occur + between respins, feel free to include that into your respin to keep track + of previous reviews. + * `Acked-by:` used in review _after_ submission. 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/check-patches b/contrib/check-patches index cea65a1f..e175b32c 100755 --- a/contrib/check-patches +++ b/contrib/check-patches @@ -11,6 +11,27 @@ if [ "$total" -eq 0 ]; then exit 0 fi +allowed_trailers=" +Fixes +Implements +References +Link +Changelog-added +Changelog-fixed +Changelog-changed +Changelog-deprecated +Cc +Suggested-by +Requested-by +Reported-by +Co-authored-by +Signed-off-by +Tested-by +Reviewed-by +Acked-by +" + + n=0 title= fail=false @@ -39,6 +60,12 @@ for rev in $revisions; do err "'Signed-off-by: $author' trailer is missing" fi + for trailer in $(git log --format="%(trailers:only,keyonly)" -1 "$rev"); do + if ! echo "$allowed_trailers" | grep -qFx "$trailer"; then + err "trailer '$trailer' is misspelled or not in the sanctioned list" + fi + done + if git log --format="%(trailers:only,unfold)" -1 "$rev" | \ grep -v '^Changelog-[a-z]\+: [A-Z`\*_].\+\.$' | \ grep -q '^Changelog-[a-z]\+: '; then |