From fc887a77e2c758647ff3e749f7a68f565d160b99 Mon Sep 17 00:00:00 2001 From: Sergey Aksenov Date: Thu, 7 May 2026 21:11:49 +0200 Subject: [PATCH 1/3] Add 'go get -tool' installation method --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index fdc6d50..4f76e4c 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,22 @@ Quickhook is a Git hook runner designed for speed. It is opinionated where it ma ## Installation +### `go get -tool` + +Go supports adding tool dependencies to `go.mod` file since version 1.24: + +```sh +$ go get -tool github.com/dirk/quickhook +$ go tool quickhook --version +1.5.0 +``` + +To uninstall: + +```sh +go get -tool github.com/dirk/quickhook@none +``` + ### `go install` If you have your $PATH set up for Go then it's as simple as: @@ -66,6 +82,14 @@ Create file .git/hooks/pre-commit? [yn] y Installed shim .git/hooks/pre-commit ``` +If you installed quickhook with `go get -tool`, use: + +```sh +$ go tool quickhook install --bin="go tool quickhook" +``` + +Replace `quickhook` with `go tool quickhook` in examples below. + Quickhook provides some options to run various hooks directly for development and testing. This way you don't have to follow the whole Git commit workflow just to exercise the new hook you're working on. ```sh From 9dd420a31d8dc5fe510d730d22279d90914967e8 Mon Sep 17 00:00:00 2001 From: Dirk Gadsden Date: Sat, 9 May 2026 23:50:03 -0700 Subject: [PATCH 2/3] Condense `go tool` instructions; update `go.mod` --- README.md | 34 ++++++++++++++++------------------ go.mod | 2 ++ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 4f76e4c..fdc4143 100644 --- a/README.md +++ b/README.md @@ -9,18 +9,24 @@ Quickhook is a Git hook runner designed for speed. It is opinionated where it ma ### `go get -tool` -Go supports adding tool dependencies to `go.mod` file since version 1.24: +For use in Go projects, Quickhook can be used as a tool dependency in `go.mod` since Go 1.24: ```sh -$ go get -tool github.com/dirk/quickhook +$ go get -tool github.com/dirk/quickhook@v1.6.2 $ go tool quickhook --version -1.5.0 +v1.6.2 +``` + +Then to install hooks: + +```sh +$ go tool quickhook install --bin="go tool quickhook" ``` To uninstall: ```sh -go get -tool github.com/dirk/quickhook@none +$ go get github.com/dirk/quickhook@none ``` ### `go install` @@ -30,7 +36,7 @@ If you have your $PATH set up for Go then it's as simple as: ```sh $ go install github.com/dirk/quickhook $ quickhook --version -1.5.0 +v1.6.2 ``` To uninstall use `clean -i`: @@ -47,13 +53,13 @@ If you're on Mac there is a [Homebrew tap for Quickhook](https://github.com/dirk $ brew tap dirk/quickhook ==> Tapping dirk/quickhook ... -Tapped 1 formula (14 files, 12.6KB). +Tapped 1 formula (15 files, 15.6KB). $ brew install quickhook -==> Fetching dirk/quickhook/quickhook -==> Downloading https://github.com/dirk/quickhook/archive/v1.5.0.tar.gz -... -/opt/homebrew/Cellar/quickhook/1.5.0: 5 files, 3.1MB, built in 2 seconds +==> Fetching downloads for: quickhook +==> Installing quickhook from dirk/quickhook +==> go build -ldflags=-s -w +/opt/homebrew/Cellar/quickhook/1.6.2: 6 files, 3.8MB, built in 5 seconds ``` ### Linux @@ -82,14 +88,6 @@ Create file .git/hooks/pre-commit? [yn] y Installed shim .git/hooks/pre-commit ``` -If you installed quickhook with `go get -tool`, use: - -```sh -$ go tool quickhook install --bin="go tool quickhook" -``` - -Replace `quickhook` with `go tool quickhook` in examples below. - Quickhook provides some options to run various hooks directly for development and testing. This way you don't have to follow the whole Git commit workflow just to exercise the new hook you're working on. ```sh diff --git a/go.mod b/go.mod index 68bdd7d..a570d50 100644 --- a/go.mod +++ b/go.mod @@ -23,3 +23,5 @@ require ( gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +tool github.com/dirk/quickhook From c1d51e84d1b428e536479e5e9808011b71cac4f4 Mon Sep 17 00:00:00 2001 From: Dirk Gadsden Date: Sat, 9 May 2026 23:57:20 -0700 Subject: [PATCH 3/3] Revert `go.mod` change --- go.mod | 2 -- 1 file changed, 2 deletions(-) diff --git a/go.mod b/go.mod index a570d50..68bdd7d 100644 --- a/go.mod +++ b/go.mod @@ -23,5 +23,3 @@ require ( gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) - -tool github.com/dirk/quickhook