File tree 3 files changed +27
-4
lines changed
3 files changed +27
-4
lines changed Original file line number Diff line number Diff line change @@ -16,13 +16,25 @@ This will set up the development support toolchain automatically. The toolchain
16
16
uses git hooks extensively, copying them from ` support/hooks ` to the ` .git `
17
17
folder.
18
18
19
- The commit hook checks can be skipped using the ` -n ` / ` - -no-verify` flags, as
19
+ The commit hook checks can be skipped using the ` --no-verify ` flags, as
20
20
so:
21
21
22
22
``` bash
23
23
git commit --no-verify
24
24
```
25
25
26
+ You can also do this by adding ` NO_VERIFY ` to ` .env ` , for example:
27
+
28
+ ``` console
29
+ $ echo NO_VERIFY=1 >> .env
30
+ ```
31
+
32
+ Or settting it in your environment:
33
+
34
+ ``` console
35
+ $ export NO_VERIFY=1
36
+ ```
37
+
26
38
## Functionality
27
39
28
40
Currently the development support toolchain exposes two main pieces of
Original file line number Diff line number Diff line change 47
47
HOOKS_DIR=" ${DOT_GIT_DIR} /hooks"
48
48
HOOKS_DIR_RELPATH=$( relpath " ${HOOKS_DIR} " " $( dirname " $0 " ) " )
49
49
50
- if [ ! -e " ${HOOKS_DIR} /prepare-commit-msg" ]; then
50
+ if [[ -n " $REINSTALL_HOOKS " ]] || [[ ! -e " ${HOOKS_DIR} /prepare-commit-msg" ] ]; then
51
51
echo " Installing hook 'prepare-commit-msg'"
52
52
ln -sf " ${HOOKS_DIR_RELPATH} /hooks/prepare-commit-msg" " ${HOOKS_DIR} /prepare-commit-msg"
53
53
fi
54
54
55
- if [ ! -e " ${HOOKS_DIR} /pre-push" ]; then
55
+ if [[ -n " $REINSTALL_HOOKS " ]] || [[ ! -e " ${HOOKS_DIR} /pre-push" ] ]; then
56
56
echo " Installing hook 'pre-push'"
57
57
ln -sf " ${HOOKS_DIR_RELPATH} /hooks/pre-push" " ${HOOKS_DIR} /pre-push"
58
58
fi
Original file line number Diff line number Diff line change 9
9
#
10
10
# $ ln -s ../../support/hooks/pre-push .git/hooks/pre-push
11
11
12
+ if [[ -e .env ]]; then
13
+ # shellcheck disable=SC1091
14
+ . .env
15
+ fi
16
+
17
+ if [[ -n " $NO_VERIFY " ]]; then
18
+ exit 0
19
+ fi
20
+
12
21
DUMMY_SHA=0000000000000000000000000000000000000000
13
22
14
- echo " Running pre-push check; to skip this step use 'push --no-verify'"
23
+ # shellcheck disable=SC2016
24
+ echo ' Running pre-push check; to skip this step use `push --no-verify` or add `NO_VERIFY=1` to `.env`'
25
+ echo
15
26
AUTHOR=$( git var GIT_AUTHOR_IDENT | sed -n ' s/^\(.*>\).*$/\1/p' )
16
27
17
28
# shellcheck disable=SC2034
You can’t perform that action at this time.
0 commit comments