File tree Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Expand file tree Collapse file tree 1 file changed +6
-11
lines changed Original file line number Diff line number Diff line change 11#! /usr/bin/env bash
2+ set -euo pipefail
23
3- echo ' Running commit script'
4-
4+ CURRENT_BRANCH=" $( git rev-parse --abbrev-ref HEAD) "
55GIT_ROOT_DIRECTORY=$( git rev-parse --show-toplevel)
66IGNORED_BRANCHES=(" dev" " master" " qa" " uat" " staging" )
77CUSTOM_IGNORED_PATH=" $GIT_ROOT_DIRECTORY /.smart-commit-ignore"
1313 IGNORED_BRANCHES=(${IGNORED_BRANCHES[@]} ${BRANCHES[@]} )
1414fi
1515
16- CURRENT_BRANCH_CMD=" git rev-parse --abbrev-ref HEAD"
17- CURRENT_BRANCH=$( eval $CURRENT_BRANCH_CMD )
18-
19- COMMIT_WITH_BRANCH=" git commit -m \" $CURRENT_BRANCH : $1 \" "
20- DEFAULT_COMMIT=" git commit -m \" $1 \" "
21-
2216IS_IGNORED=false
2317
2418for branch in " ${IGNORED_BRANCHES[@]} " ;
@@ -30,10 +24,11 @@ for branch in "${IGNORED_BRANCHES[@]}";
3024 fi
3125done
3226
27+
3328if [ " $IS_IGNORED " == false ]
3429then
35- echo " Commiting with branch name -> $CURRENT_BRANCH "
36- eval $COMMIT_WITH_BRANCH
30+ # Edit your config here
31+ git commit -m " $CURRENT_BRANCH : $1 "
3732else
38- eval $DEFAULT_COMMIT
33+ git commit -m " $1 "
3934fi
You can’t perform that action at this time.
0 commit comments