summary refs log tree commit diff stats
path: root/prepare-commit-msg
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-12-24 17:59:52 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2024-12-24 17:59:52 +0100
commit8245579c8af73c8f40f5978878c7944c814ba04f (patch)
tree006caa951e345f481be3b91b85bcfda1061956d9 /prepare-commit-msg
parentrefactor(modules/impermanence): Migrate to by-name while distributing mods (diff)
downloadnixos-server-8245579c8af73c8f40f5978878c7944c814ba04f.tar.gz
nixos-server-8245579c8af73c8f40f5978878c7944c814ba04f.zip
[WIP]
Diffstat (limited to 'prepare-commit-msg')
-rwxr-xr-xprepare-commit-msg24
1 files changed, 24 insertions, 0 deletions
diff --git a/prepare-commit-msg b/prepare-commit-msg
new file mode 100755
index 0000000..6066d40
--- /dev/null
+++ b/prepare-commit-msg
@@ -0,0 +1,24 @@
+#!/bin/sh
+#
+# Insert selected git-bug issue identifier in the comment.
+# if no selected issue, print in comments the list of open issues.
+#
+cmtChar=`git config --get core.commentchar`
+hashChar="#"
+if [ "$cmtChar" = "" ]
+then
+	cmtChar="#"
+fi
+if [ "$cmtChar" = "#" ]
+then
+	hashChar=":"
+fi
+
+ISSUE=`git bug show --field shortId`
+if [ "$ISSUE" = "" ]
+then
+	echo "$cmtChar !!!!! insert $hashChar<issue_id> in your comment, pick one in list below." >> "$1"
+	git bug ls status:open |sed 's/ open\t/ /'| sed "s/^/$cmtChar/" >> "$1"
+else
+	sed -i "1i$hashChar$ISSUE " "$1"
+fi