Skip to content

Instantly share code, notes, and snippets.

View akash1233's full-sized avatar

dharma akash1233

  • Workday
  • Atlanta
View GitHub Profile
@akash1233
akash1233 / pre-receive.sh
Last active April 16, 2024 02:38
pre-receive git hooks for checking the commit message
#!/bin/bash
#
# check commit messages for pivotal tracker issue numbers formatted as [#stort-id]along with commit message
REGEX="\[#[0-9]*\]"
ERROR_MSG="[POLICY] The commit doesn't reference a PIVOTAL tracker issue"
while read OLDREV NEWREV REFNAME ; do
for COMMIT in `git rev-list $OLDREV..$NEWREV`;
do
MESSAGE=`git cat-file commit $COMMIT | sed '1,/^$/d'`