[mutter] ci: Nag about invalid commit message subject prefixes
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] ci: Nag about invalid commit message subject prefixes
- Date: Tue, 2 Apr 2019 12:09:37 +0000 (UTC)
commit 7b3dee2d9706753bc1f8bf13ada66ab51df45b06
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Mon Apr 1 13:10:10 2019 +0200
ci: Nag about invalid commit message subject prefixes
Prefixes use an abbreviated form of the module or section being changed.
For example, changes to MetaBackend/meta-backend.c are prefixed with
`backend:` and generic changes to src/x11/ are prefixed `x11:`.
This extra nit picking check is meant to avoid using non-abbreviated
prefixes, e.g. `MetaBackend:`, or `meta-backend:`, other prefixes are
Currently consisting of only a "blacklist".
https://gitlab.gnome.org/GNOME/mutter/merge_requests/519
.gitlab-ci/check-commit-log.sh | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
---
diff --git a/.gitlab-ci/check-commit-log.sh b/.gitlab-ci/check-commit-log.sh
index cc3bcee60..b5e7bae08 100755
--- a/.gitlab-ci/check-commit-log.sh
+++ b/.gitlab-ci/check-commit-log.sh
@@ -23,9 +23,30 @@ function commit_message_has_url() {
return $?
}
+function commit_message_subject_is_compliant() {
+ commit=$1
+ commit_message_subject=$(git show -s --format='format:%s' $commit)
+
+ if echo "$commit_message_subject" | grep -qe "\(^meta-\|^Meta\)"; then
+ echo " - message subject should not be prefixed with 'meta-' or 'Meta'"
+ return 1
+ fi
+
+ return 0
+}
+
for commit in $commits; do
+ commit_short=$(echo $commit | cut -c -8)
+
if ! commit_message_has_url $commit; then
- echo "Missing merge request or issue URL on commit $(echo $commit | cut -c -8)"
+ echo "Missing merge request or issue URL on commit $commit_short"
+ exit 1
+ fi
+
+ errors=$(commit_message_subject_is_compliant $commit)
+ if [ $? != 0 ]; then
+ echo "Commit message for $commit_short is not compliant:"
+ echo "$errors"
exit 1
fi
done
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]