This file contains hidden or 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
| gcamm() { | |
| local branch=$(git rev-parse --abbrev-ref HEAD 2>/dev/null) | |
| if [[ -z "$branch" ]]; then | |
| echo "Not in a git repo!" | |
| return 1 | |
| fi | |
| local ticket=$(echo "$branch" | grep -oE '[A-Z]+-[0-9]+') | |
| if [[ -z "$ticket" ]]; then | |
| echo "No ticket ID found in branch name!" |