githooks/prepare-commit-msg: add systemd prefixes

Extend the hook to automatically make useful titles for packages in
systemd directories. We had two styles for modifying the systemd package
itself, either "systemd/systemd:" or "systemd:". Pick the shorter one.

Part-of: https://gitlab.postmarketos.org/postmarketos/pmaports/-/merge_requests/6348
This commit is contained in:
Oliver Smith
2025-03-23 14:28:11 +01:00
parent d203541889
commit e6bda25a0b
+6
View File
@@ -40,6 +40,12 @@ lcp=$(git diff-index --name-only --cached HEAD | longest_common_prefix)
prefix=""
case "$lcp" in
extra-repos/systemd/systemd/*)
prefix="systemd"
;;
extra-repos/systemd/*)
prefix="systemd/$(echo "$lcp" | cut -d/ -f3)"
;;
device/*/*)
prefix="$(echo "$lcp" | cut -d/ -f3)"
;;