Skip to content

Commit bd3cf83

Browse files
authored
Merge pull request #8 from sbimochan/revert-6-master
Revert "Allow people to add custom branches"
2 parents dfc2663 + 1a01322 commit bd3cf83

2 files changed

Lines changed: 1 addition & 29 deletions

File tree

README.md

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,6 @@ $ commit "New feature"
3030
git commit -m "New feature"
3131
```
3232

33-
You can create a file `.ignore` in your directory to add custom branches you want to ignore. Example `.ignore` file:
34-
35-
```
36-
hot-fix
37-
sprint-11
38-
new-feature
39-
```
40-
4133
## License
4234

4335
[MIT](LICENSE)

commit

100755100644
Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,13 @@
22

33
echo 'Running commit script'
44

5-
IGNORED_BRANCHES=("dev" "master" "qa" "uat" "staging")
6-
7-
IGNORED_PATH="./.ignore"
8-
if [ -f "$IGNORED_PATH" ]
9-
then
10-
CUSTOM_BRANCHES=$(cat "$IGNORED_PATH")
11-
BRANCHES=( $CUSTOM_BRANCHES )
12-
IGNORED_BRANCHES=( ${IGNORED_BRANCHES[@]} ${BRANCHES[@]} )
13-
fi
14-
155
CURRENT_BRANCH_CMD="git rev-parse --abbrev-ref HEAD"
166
CURRENT_BRANCH=$(eval $CURRENT_BRANCH_CMD)
177

188
COMMIT_WITH_BRANCH="git commit -m \"$CURRENT_BRANCH: $1\""
199
DEFAULT_COMMIT="git commit -m \"$1\""
20-
IS_IGNORED=false
21-
22-
for branch in "${IGNORED_BRANCHES[@]}";
23-
do
24-
if [ "$CURRENT_BRANCH" == $branch ]
25-
then
26-
IS_IGNORED=true
27-
break
28-
fi
29-
done
3010

31-
if [ "$IS_IGNORED" == false ]
11+
if [ "$CURRENT_BRANCH" != "dev" ] && [ "$CURRENT_BRANCH" != "master" ] && [ "$CURRENT_BRANCH" != "qa" ] && [ "$CURRENT_BRANCH" != "uat" ] && [ "$CURRENT_BRANCH" != "staging" ]
3212
then
3313
echo "Commiting with branch name -> $CURRENT_BRANCH"
3414
eval $COMMIT_WITH_BRANCH

0 commit comments

Comments
 (0)