Skip to content

Instantly share code, notes, and snippets.

View sudosubin's full-sized avatar

Subin Kim sudosubin

  • Seoul, South Korea
  • 16:35 (UTC +09:00)
View GitHub Profile
@sudosubin
sudosubin / prepare-commit-msg.sh
Created April 18, 2022 02:14
How to auto prepend Jira ticket id to git commit msg?
#!/usr/bin/env bash
COMMIT_MSG_FILE=$1
# COMMIT_SOURCE=$2
# SHA1=$3
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
if [ -n "$BRANCH_NAME" ] && [ "$BRANCH_NAME" != "HEAD" ]; then
PREFIX_PATTERN="[A-Z]{2,5}-[0-9]+"