Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Task/914 allow standard GitHub branch names to also update gittemplatemessage #916

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
#914: catch error for unrecognized branch names that broke the post-c…
…heckout hook
JoernBerkefeld committed May 17, 2023
commit 5557d8b64bfcc20bae4532389f00403879a0535e
11 changes: 8 additions & 3 deletions .husky/post-checkout
Original file line number Diff line number Diff line change
@@ -3,9 +3,14 @@

# ### git commit message template ###
git config commit.template .git/templatemessage
TICKETID=`git rev-parse --abbrev-ref HEAD | LC_ALL=en_US.utf8 grep -oP '((feature|bug|bugfix|fix|hotfix|task|chore)\/)\K\d{1,7}'`
echo "[POST_CHECKOUT] Setting template commit to $TICKETID"
echo "#$TICKETID: " > ".git/templatemessage"
TICKETID=`git rev-parse --abbrev-ref HEAD | LC_ALL=en_US.utf8 grep -oP '((feature|bug|bugfix|fix|hotfix|task|chore)\/)\K\d{1,7}' || true`
if [ -z "$TICKETID" ]
then
TICKETID="0"
fi
TEMPLATE="#$TICKETID: "
echo "[POST_CHECKOUT] Setting template commit to '$TEMPLATE'"
echo $TEMPLATE > ".git/templatemessage"


# ### run npm install ###