Skip to content

Instantly share code, notes, and snippets.

View sreeram-venkitesh's full-sized avatar
☸️

Sreeram Venkitesh sreeram-venkitesh

☸️
View GitHub Profile
@VarunSriram99
VarunSriram99 / prepare-commit-msg
Last active July 4, 2023 14:21
Pre-commit hook to prefix the jira issue number to commit message using bash
#!/bin/sh
# Get current branch name
branch_name="$(git rev-parse --symbolic-full-name --abbrev-ref HEAD)"
# Replace or add the board name abbreviations here
jira_abbreviations=("JIRA_BOARD_ABBREVIATION")
# Check if current branch is a feature branch i.e. starts with a ticket number
check_is_issue_branch () {
for abbrv in "${jira_abbreviations[@]}"