2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-30 21:45:37 +00:00

[#1042] prepare-commit-msg updated

This commit is contained in:
Tomek Mrugalski
2019-12-13 17:51:52 +01:00
parent 1157db4698
commit 250c94d8e6

View File

@@ -1,6 +1,7 @@
#!/bin/sh
BRANCH=`git branch | grep '^\*' | cut -b3-`
ISSUE=`git branch | grep -o '^\* [0-9]*' | cut -b3-`
if test "$BRANCH" == "master"; then
echo "ERROR: You are on branch $BRANCH"
@@ -9,7 +10,11 @@ if test "$BRANCH" == "master"; then
exit 1
fi
BRANCH_NUMBER=`git branch | grep -o '^\* [0-9]*' | cut -b3-`
/bin/echo -n "[#$BRANCH_NUMBER] " > "$1.msg"
if [ -n "$ISSUE" ]; then
/bin/echo -n "[#$ISSUE] " > "$1.msg"
else
/bin/echo -n "[$BRANCH] " > "$1.msg"
fi
cat "$1" >> "$1.msg"
mv "$1.msg" "$1"