mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-09-01 06:25:34 +00:00
[#1042] prepare-commit-msg updated
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
BRANCH=`git branch | grep '^\*' | cut -b3-`
|
BRANCH=`git branch | grep '^\*' | cut -b3-`
|
||||||
|
ISSUE=`git branch | grep -o '^\* [0-9]*' | cut -b3-`
|
||||||
|
|
||||||
if test "$BRANCH" == "master"; then
|
if test "$BRANCH" == "master"; then
|
||||||
echo "ERROR: You are on branch $BRANCH"
|
echo "ERROR: You are on branch $BRANCH"
|
||||||
@@ -9,7 +10,11 @@ if test "$BRANCH" == "master"; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
BRANCH_NUMBER=`git branch | grep -o '^\* [0-9]*' | cut -b3-`
|
if [ -n "$ISSUE" ]; then
|
||||||
/bin/echo -n "[#$BRANCH_NUMBER] " > "$1.msg"
|
/bin/echo -n "[#$ISSUE] " > "$1.msg"
|
||||||
|
else
|
||||||
|
/bin/echo -n "[$BRANCH] " > "$1.msg"
|
||||||
|
fi
|
||||||
|
|
||||||
cat "$1" >> "$1.msg"
|
cat "$1" >> "$1.msg"
|
||||||
mv "$1.msg" "$1"
|
mv "$1.msg" "$1"
|
||||||
|
Reference in New Issue
Block a user