Created
March 12, 2019 16:02
-
-
Save damirm/a5b0ee73eb81f9ff8119ba749ac6e92a to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
# Usage: | |
# $ git commit -m "$(t): Commit message" | |
# | |
# Where "t" it's provided script below. It should be in $PATH. | |
ISSUE_RE="[A-Z]+-\d+" | |
ISSUE=$(git symbolic-ref --short HEAD 2>&1 | grep -Eo ${ISSUE_RE}) | |
if [ -n "${ISSUE}" ]; then | |
echo "${ISSUE}" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment