Skip to content

Commit 89433dd

Browse files
authored
Avoid git subcommands (#8)
* Remove usage of git sub-commands Usage of `git hooks` causes problems in some environment, there are no reason to use the command this way instead of the calling the script directly, i.e. `git-hooks`. * Bump version
1 parent 37eb7cb commit 89433dd

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

CHANGELOG.md

+6
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ Security - in case of vulnerabilities.
1919

2020
_TBD_
2121

22+
## [1.0.3] 2020-05-10
23+
24+
### Changed
25+
26+
- Remove usage of Git sub-commands `git hooks` in favour of direct script call `git-hooks`
27+
2228
## [1.0.2] 2019-10-25
2329

2430
### Fixed

README.md

+5-10
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ curl -o /usr/local/bin/git-hooks https://raw.githubusercontent.com/slavcodev/git
1414
chmod +x /usr/local/bin/git-hooks
1515
~~~
1616

17-
Run `git hooks install` in a git project to tell it to use `git-hooks`
18-
and `git hooks uninstall` at any time to revert to your previous state.
17+
Run `git-hooks install` in a git project to tell it to use `git-hooks`
18+
and `git-hooks uninstall` at any time to revert to your previous state.
1919
_(Check options of these commands to specify installation)._
2020

2121
## TL;DR
@@ -26,7 +26,7 @@ such as testing, code linting, etc, but Git is limited to only one script per ev
2626
There is where `git-hooks` comes into play.
2727

2828
The `git-hooks` utilizes the Git configs only. On installation, it configures `core.hooksPath`
29-
to tell Git to run `git hooks trigger <hook-name>` command.
29+
to tell Git to run `git-hooks trigger <hook-name>` command.
3030

3131
On trigger the hooks, `git-hooks` looks in git configs for list of hooks needed to execute.
3232

@@ -73,26 +73,21 @@ you have to add it config, i.e.
7373
default=".git/hooks"
7474
~~~
7575

76-
_A additional note on git sub-commands:
77-
When you type `git hooks` git actually looks for an executable called `git-hooks`.
78-
This is done automatically, so although we're invoking `git hooks` in the examples in this doc,
79-
you can also use `git-hooks` interchangeably._
80-
8176
## Locations
8277

8378
The `git-hooks` respects the config location supported by `git-config`
8479
([see more in documentation](https://git-scm.com/docs/git-config)).
8580

8681
Example how ot install `git-hooks` globally:
8782
~~~bash
88-
git hooks install --global
83+
git-hooks install --global
8984
~~~
9085

9186
## Documentation
9287

9388
For more details see `git-hooks` help:
9489
~~~bash
95-
git hooks --help
90+
git-hooks --help
9691
~~~
9792

9893
## Contributing

src/git-hooks

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ FCS='\033[0;37m' # Light gray (silver)
7575
NC='\033[0m'
7676

7777
GIT_HOOKS_NAME="Git Hooks"
78-
GIT_HOOKS_VERSION="1.0.2"
78+
GIT_HOOKS_VERSION="1.0.3"
7979
GIT_HOOKS_URL="https://github.com/slavcodev/git-hooks"
8080
GIT_HOOKS_ABOUT="${FCG}$GIT_HOOKS_NAME${NC} version ${FCY}$GIT_HOOKS_VERSION${NC}"
8181
GIT_HOOKS_HELP="$GIT_HOOKS_ABOUT
@@ -348,7 +348,7 @@ make_hooks() {
348348

349349
for name in "${HOOKS_LIST[@]}"; do
350350
log debug "Writing trigger: $name"
351-
echo "#!/bin/sh\n\ngit hooks trigger \$(basename \$0) -- \$@" > "${GIT_HOOKS_TRIGGERS_DIR}/$name"
351+
echo "#!/bin/sh\n\ngit-hooks trigger \$(basename \$0) -- \$@" > "${GIT_HOOKS_TRIGGERS_DIR}/$name"
352352
chmod +x "${GIT_HOOKS_TRIGGERS_DIR}/$name"
353353
done
354354
}

0 commit comments

Comments
 (0)