File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+ #
3
+ # git prepare-commit-msg hook for automatically prepending an issue key
4
+ # from the start of the current branch name to commit messages.
5
+
6
+ # check if commit is merge commit or a commit ammend
7
+ if [ $2 = " merge" ] || [ $2 = " commit" ]; then
8
+ exit
9
+ fi
10
+
11
+ ISSUE_KEY=` git branch | grep -o " \* \(.*/\)*CSS-[0-9]\+" | grep -o " CSS-[0-9]\+" `
12
+ if [ $? -ne 0 ]; then
13
+ # no issue key in branch, use the default message
14
+ exit
15
+ fi
16
+
17
+ # issue key matched from branch prefix, prepend to commit message
18
+ TEMP=` mktemp /tmp/commitmsg-XXXXX`
19
+ (echo " $( cat $1 ) [$ISSUE_KEY ]" ) > $TEMP
20
+ cat $TEMP > $1
Original file line number Diff line number Diff line change
1
+ {
2
+ "recommendations" : [
3
+ " gruntfuggly.todo-tree" ,
4
+ " nrwl.angular-console" ,
5
+ " esbenp.prettier-vscode" ,
6
+ " vunguyentuan.vscode-postcss" ,
7
+ " mariusschulz.yarn-lock-syntax"
8
+ ]
9
+ }
You can’t perform that action at this time.
0 commit comments