Last active
May 31, 2020 14:59
-
-
Save LordZardeck/bf0eb67f7545157a3ea00cfec118d1de to your computer and use it in GitHub Desktop.
Git hook to prepend Active Collab GUIDs for tasks to the commit message. Requires branch names to contain the GUID, such as `feature/ABC-123_456-my-branch-feature`. To install, place the file in your project's `.git/hooks` directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
ticket=$(git symbolic-ref HEAD | grep -e '[A-Z]\+-[0-9]\+_[0-9]\+' -o) | |
if [ -n "$ticket" ]; then | |
echo "$ticket - $(cat $1)" > $1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment