Revisions
-
pgilad revised this gist
Dec 1, 2014 . 1 changed file with 4 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -3,13 +3,14 @@ # set this to your active development branch develop_branch="develop" current_branch="$(git rev-parse --abbrev-ref HEAD)" # only check commit messages on main development branch [ "$current_branch" != "$develop_branch" ] && exit 0 # regex to validate in commit msg commit_regex='(wap-[0-9]+|merge)' error_msg="Aborting commit. Your commit message is missing either a JIRA Issue ('WAP-1111') or 'Merge'" if ! grep -iqE "$commit_regex" "$1"; then echo "$error_msg" >&2 exit 1 -
pgilad revised this gist
Oct 25, 2014 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -4,7 +4,7 @@ develop_branch="develop" current_branch="$(git rev-parse --abbrev-ref HEAD)" # regex to validate in commit msg commit_regex='(wap-[0-9]+|merge)' error_msg="Aborting commit. Your commit message is missing either a JIRA Issue ('WAP-1111') or 'Merge'" # only check commit messages on main development branch -
pgilad revised this gist
Oct 23, 2014 . 1 changed file with 6 additions and 6 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -8,15 +8,15 @@ ## Shell example ```bash curl https://gist.githubusercontent.com/pgilad/5d7e4db725a906bd7aa7/raw/feba0ca462f87a382cfbc3eddfcc529ceb9b7350/commit-msg.sh > .git/hooks/commit-msg rm .git/hooks/commit-msg.sample chmod +x .git/hooks/commit-msg vim .git/hooks/commit-msg echo "Profit $$" ```
-
pgilad renamed this gist
Oct 23, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
pgilad renamed this gist
Oct 23, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
pgilad renamed this gist
Oct 23, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
pgilad revised this gist
Oct 23, 2014 . 1 changed file with 16 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -4,4 +4,19 @@ - make sure your delete the sample file `.git/hooks/commit-msg.sample` - Make commit msg executable. `chmod +x .git/hooks/commit-msg` - Edit `commit-msg` to better fit your development branch, commit regex and error message - Profit $$ ## Shell example ```sh $ curl https://gist.githubusercontent.com/pgilad/5d7e4db725a906bd7aa7/raw/feba0ca462f87a382cfbc3eddfcc529ceb9b7350/commit-msg > .git/hooks/commit-msg $ rm .git/hooks/commit-msg.sample $ chmod +x .git/hooks/commit-msg $ vim .git/hooks/commit-msg $ echo "Profit $$" ```
-
pgilad renamed this gist
Oct 23, 2014 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
pgilad revised this gist
Oct 23, 2014 . 1 changed file with 7 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,7 @@ ## Instructions - copy the file `commit-msg` to `.git/hooks/commit-msg` - make sure your delete the sample file `.git/hooks/commit-msg.sample` - Make commit msg executable. `chmod +x .git/hooks/commit-msg` - Edit `commit-msg` to better fit your development branch, commit regex and error message - Profit $$ -
pgilad created this gist
Oct 23, 2014 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ #!/usr/bin/env bash # set this to your active development branch develop_branch="develop" current_branch="$(git rev-parse --abbrev-ref HEAD)" # regex to validate in commit msg commit_regex='(wap-\d+|merge)' error_msg="Aborting commit. Your commit message is missing either a JIRA Issue ('WAP-1111') or 'Merge'" # only check commit messages on main development branch [ "$current_branch" != "$develop_branch" ] && exit 0 if ! grep -iqE "$commit_regex" "$1"; then echo "$error_msg" >&2 exit 1 fi