Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: evilmartians/lefthook
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.7.7
Choose a base ref
...
head repository: evilmartians/lefthook
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.7.8
Choose a head ref
  • 5 commits
  • 23 files changed
  • 1 contributor

Commits on Jul 25, 2024

  1. ci: use latest goreleaser (#784)

    mrexox authored Jul 25, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    065a13e View commit details

Commits on Jul 26, 2024

  1. ci: update workflow files (#787)

    * ci: update workflow files
    
    * ci: use go.mod as go version
    
    * ci: fetch then install Go
    
    * ci: set go.mod file
    mrexox authored Jul 26, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    f1d85d3 View commit details
  2. fix: explicitly pass static flag to linker (#788)

    * fix: pass static flag to linker
    
    * fix: set version=2 in goreleaser
    
    * fix: when building with goreleaser also create archives and packages
    
    * ci: also trimpath
    
    * ci: add --snapshot
    mrexox authored Jul 26, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    ac882cc View commit details
  3. fix: npm fix packages (#789)

    mrexox authored Jul 26, 2024

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    2f3f53f View commit details
  4. 1.7.8: trying to fix lefthook-linux-x64 linking issue

    mrexox committed Jul 26, 2024

    Verified

    This commit was signed with the committer’s verified signature.
    mrexox Valentin Kiselev
    Copy the full SHA
    b7309ae View commit details
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -10,11 +10,11 @@ jobs:
name: golangci-lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
- uses: actions/checkout@v4
go-version-file: go.mod
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -23,7 +23,7 @@ jobs:
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
go-version-file: go.mod

- name: Install Snapcraft
uses: samuelmeuli/action-snapcraft@v1
@@ -34,10 +34,10 @@ jobs:
mkdir -p $HOME/.cache/snapcraft/stage-packages
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v5
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
version: '~> v2'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26 changes: 12 additions & 14 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -9,16 +9,15 @@ jobs:
test:
strategy:
matrix:
go-version: [1.22.x]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v4
go-version-file: go.mod
- name: Test
run: go test ./... -coverprofile coverage.out
- name: Report coverage
@@ -31,18 +30,17 @@ jobs:
test-integrity:
strategy:
matrix:
go-version: [1.22.x]
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
env:
GOCOVERDIR: ${{ github.workspace }}/_icoverdir_
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- name: Checkout code
uses: actions/checkout@v4
go-version-file: go.mod
- name: Prepare lefthook
run: |
mkdir _icoverdir_
@@ -67,18 +65,18 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: 1.22.x
- name: Checkout code
uses: actions/checkout@v4
go-version-file: go.mod
- name: Build binaries
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: build --snapshot --skip=validate --clean
version: '~> v2'
args: release --snapshot --skip=publish --skip=snapcraft --skip=validate --clean
- name: Tar binaries to preserve executable bit
run: 'tar -cvf lefthook-binaries.tar --directory dist/ $(find dist/ -executable -type f -printf "%P\0" | xargs --null)'
- name: Upload binaries as artifacts
@@ -95,5 +93,5 @@ jobs:
steps:
- uses: coverallsapp/github-action@v2
with:
carryforward: "integration-1.22.x ubuntu-latest,integration-1.22.x macos-latest,integration-1.22.x windows-latest,1.22.x ubuntu-latest,1.22.x macos-latest,1.22.x windows-latest"
carryforward: "integration-ubuntu-latest,integration-macos-latest,integration-windows-latest,ubuntu-latest,macos-latest,windows-latest"
parallel-finished: true
9 changes: 7 additions & 2 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
version: 2
project_name: lefthook
before:
hooks:
@@ -25,8 +26,10 @@ builds:
goarch: 386
- goos: freebsd
goarch: 386
flags:
- -trimpath
ldflags:
- -s -w -X github.com/evilmartians/lefthook/internal/version.commit={{.Commit}}
- -s -w -extldflags '-static' -X github.com/evilmartians/lefthook/internal/version.commit={{.Commit}}

# Full lefthook binary
- id: lefthook
@@ -48,8 +51,10 @@ builds:
goarch: 386
- goos: freebsd
goarch: 386
flags:
- -trimpath
ldflags:
- -s -w -X github.com/evilmartians/lefthook/internal/version.commit={{.Commit}}
- -s -w -extldflags '-static' -X github.com/evilmartians/lefthook/internal/version.commit={{.Commit}}

archives:
- id: lefthook
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,13 @@

## master (unreleased)

## 1.7.8 (2024-07-26)

- fix: npm fix packages ([#789](https://github.com/evilmartians/lefthook/pull/789)) by @mrexox
- fix: explicitly pass static flag to linker ([#788](https://github.com/evilmartians/lefthook/pull/788)) by @mrexox
- ci: update workflow files ([#787](https://github.com/evilmartians/lefthook/pull/787)) by @mrexox
- ci: use latest goreleaser ([#784](https://github.com/evilmartians/lefthook/pull/784)) by @mrexox

## 1.7.7 (2024-07-24)

- fix: multiple excludes ([#782](https://github.com/evilmartians/lefthook/pull/782)) by @mrexox
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
COMMIT_HASH = $(shell git rev-parse HEAD)

build:
go build -ldflags "-s -w -X github.com/evilmartians/lefthook/internal/version.commit=$(COMMIT_HASH)" -o lefthook
go build -ldflags "-s -w -extldflags '-static' -X github.com/evilmartians/lefthook/internal/version.commit=$(COMMIT_HASH)" -o lefthook

build-with-coverage:
go build -cover -ldflags "-s -w -X github.com/evilmartians/lefthook/internal/version.commit=$(COMMIT_HASH)" -o lefthook
go build -cover -ldflags "-s -w extldflags '-static' -X github.com/evilmartians/lefthook/internal/version.commit=$(COMMIT_HASH)" -o lefthook

install: build
cp lefthook $$(go env GOPATH)/bin
2 changes: 1 addition & 1 deletion docs/install.md
Original file line number Diff line number Diff line change
@@ -81,7 +81,7 @@ You can find the Swift wrapper plugin [here](https://github.com/csjones/lefthook
Utilize lefthook in your Swift project using Swift Package Manager:

```swift
.package(url: "https://github.com/csjones/lefthook-plugin.git", exact: "1.7.7"),
.package(url: "https://github.com/csjones/lefthook-plugin.git", exact: "1.7.8"),
```

Or, with [mint](https://github.com/yonaskolb/Mint):
2 changes: 1 addition & 1 deletion internal/git/command_executor.go
Original file line number Diff line number Diff line change
@@ -71,7 +71,7 @@ func (c CommandExecutor) CmdLinesWithinFolder(cmd []string, folder string) ([]st
}

func (c CommandExecutor) execute(cmd []string, root string) (string, error) {
out := bytes.NewBuffer(make([]byte, 0))
out := new(bytes.Buffer)
err := c.cmd.Run(cmd, root, system.NullReader, out)
strOut := out.String()

4 changes: 2 additions & 2 deletions internal/lefthook/runner/runner.go
Original file line number Diff line number Diff line change
@@ -145,7 +145,7 @@ func (r *Runner) runLFSHook(ctx context.Context) error {
log.Debugf(
"[git-lfs] executing hook: git lfs %s %s", r.HookName, strings.Join(r.GitArgs, " "),
)
out := bytes.NewBuffer(make([]byte, 0))
out := new(bytes.Buffer)
err := r.cmd.RunWithContext(
ctx,
append(
@@ -521,7 +521,7 @@ func (r *Runner) run(ctx context.Context, opts exec.Options, follow bool) bool {
return err == nil
}

out := bytes.NewBuffer(make([]byte, 0))
out := new(bytes.Buffer)

err := r.executor.Execute(ctx, opts, in, out)

2 changes: 1 addition & 1 deletion internal/version/version.go
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@ import (
"strconv"
)

const version = "1.7.7"
const version = "1.7.8"

var (
// Is set via -X github.com/evilmartians/lefthook/internal/version.commit={commit}.
9 changes: 6 additions & 3 deletions packaging/npm-bundled/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
{
"name": "@evilmartians/lefthook",
"version": "1.7.7",
"version": "1.7.8",
"description": "Simple git hooks manager",
"main": "bin/index.js",
"bin": {
"lefthook": "./bin/index.js"
"lefthook": "bin/index.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/evilmartians/lefthook.git"
},
"repository": "https://github.com/evilmartians/lefthook",
"keywords": [
"git",
"hook",
9 changes: 6 additions & 3 deletions packaging/npm-installer/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
{
"name": "@evilmartians/lefthook-installer",
"version": "1.7.7",
"version": "1.7.8",
"description": "Simple git hooks manager",
"main": "bin/index.js",
"bin": {
"lefthook": "./bin/index.js"
"lefthook": "bin/index.js"
},
"repository": {
"type": "git",
"url": "git+https://github.com/evilmartians/lefthook.git"
},
"repository": "https://github.com/evilmartians/lefthook",
"keywords": [
"git",
"hook",
7 changes: 5 additions & 2 deletions packaging/npm/lefthook-darwin-arm64/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{
"name": "lefthook-darwin-arm64",
"version": "1.7.7",
"version": "1.7.8",
"description": "The macOS ARM 64-bit binary for lefthook, git hooks manager.",
"preferUnplugged": false,
"repository": "https://github.com/evilmartians/lefthook",
"repository": {
"type": "git",
"url": "git+https://github.com/evilmartians/lefthook.git"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/evilmartians/lefthook/issues",
7 changes: 5 additions & 2 deletions packaging/npm/lefthook-darwin-x64/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{
"name": "lefthook-darwin-x64",
"version": "1.7.7",
"version": "1.7.8",
"description": "The macOS 64-bit binary for lefthook, git hooks manager.",
"preferUnplugged": false,
"repository": "https://github.com/evilmartians/lefthook",
"repository": {
"type": "git",
"url": "git+https://github.com/evilmartians/lefthook.git"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/evilmartians/lefthook/issues",
7 changes: 5 additions & 2 deletions packaging/npm/lefthook-freebsd-arm64/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{
"name": "lefthook-freebsd-arm64",
"version": "1.7.7",
"version": "1.7.8",
"description": "The FreeBSD ARM 64-bit binary for lefthook, git hooks manager.",
"preferUnplugged": false,
"repository": "https://github.com/evilmartians/lefthook",
"repository": {
"type": "git",
"url": "git+https://github.com/evilmartians/lefthook.git"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/evilmartians/lefthook/issues",
7 changes: 5 additions & 2 deletions packaging/npm/lefthook-freebsd-x64/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{
"name": "lefthook-freebsd-x64",
"version": "1.7.7",
"version": "1.7.8",
"description": "The FreeBSD 64-bit binary for lefthook, git hooks manager.",
"preferUnplugged": false,
"repository": "https://github.com/evilmartians/lefthook",
"repository": {
"type": "git",
"url": "git+https://github.com/evilmartians/lefthook.git"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/evilmartians/lefthook/issues",
7 changes: 5 additions & 2 deletions packaging/npm/lefthook-linux-arm64/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{
"name": "lefthook-linux-arm64",
"version": "1.7.7",
"version": "1.7.8",
"description": "The Linux ARM 64-bit binary for lefthook, git hooks manager.",
"preferUnplugged": false,
"repository": "https://github.com/evilmartians/lefthook",
"repository": {
"type": "git",
"url": "git+https://github.com/evilmartians/lefthook.git"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/evilmartians/lefthook/issues",
7 changes: 5 additions & 2 deletions packaging/npm/lefthook-linux-x64/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{
"name": "lefthook-linux-x64",
"version": "1.7.7",
"version": "1.7.8",
"description": "The Linux 64-bit binary for lefthook, git hooks manager.",
"preferUnplugged": false,
"repository": "https://github.com/evilmartians/lefthook",
"repository": {
"type": "git",
"url": "git+https://github.com/evilmartians/lefthook.git"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/evilmartians/lefthook/issues",
7 changes: 5 additions & 2 deletions packaging/npm/lefthook-windows-arm64/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{
"name": "lefthook-windows-arm64",
"version": "1.7.7",
"version": "1.7.8",
"description": "The Windows ARM 64-bit binary for lefthook, git hooks manager.",
"preferUnplugged": false,
"repository": "https://github.com/evilmartians/lefthook",
"repository": {
"type": "git",
"url": "git+https://github.com/evilmartians/lefthook.git"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/evilmartians/lefthook/issues",
7 changes: 5 additions & 2 deletions packaging/npm/lefthook-windows-x64/package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{
"name": "lefthook-windows-x64",
"version": "1.7.7",
"version": "1.7.8",
"description": "The Windows 64-bit binary for lefthook, git hooks manager.",
"preferUnplugged": false,
"repository": "https://github.com/evilmartians/lefthook",
"repository": {
"type": "git",
"url": "git+https://github.com/evilmartians/lefthook.git"
},
"license": "MIT",
"bugs": {
"url": "https://github.com/evilmartians/lefthook/issues",
23 changes: 13 additions & 10 deletions packaging/npm/lefthook/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
{
"name": "lefthook",
"version": "1.7.7",
"version": "1.7.8",
"description": "Simple git hooks manager",
"repository": "https://github.com/evilmartians/lefthook",
"repository": {
"type": "git",
"url": "git+https://github.com/evilmartians/lefthook.git"
},
"main": "bin/index.js",
"bin": {
"lefthook": "bin/index.js"
@@ -20,14 +23,14 @@
},
"homepage": "https://github.com/evilmartians/lefthook#readme",
"optionalDependencies": {
"lefthook-darwin-arm64": "1.7.7",
"lefthook-darwin-x64": "1.7.7",
"lefthook-linux-arm64": "1.7.7",
"lefthook-linux-x64": "1.7.7",
"lefthook-freebsd-arm64": "1.7.7",
"lefthook-freebsd-x64": "1.7.7",
"lefthook-windows-arm64": "1.7.7",
"lefthook-windows-x64": "1.7.7"
"lefthook-darwin-arm64": "1.7.8",
"lefthook-darwin-x64": "1.7.8",
"lefthook-linux-arm64": "1.7.8",
"lefthook-linux-x64": "1.7.8",
"lefthook-freebsd-arm64": "1.7.8",
"lefthook-freebsd-x64": "1.7.8",
"lefthook-windows-arm64": "1.7.8",
"lefthook-windows-x64": "1.7.8"
},
"scripts": {
"postinstall": "node postinstall.js"
2 changes: 1 addition & 1 deletion packaging/pack.rb
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@

require "fileutils"

VERSION = "1.7.7"
VERSION = "1.7.8"

ROOT = File.join(__dir__, "..")
DIST = File.join(ROOT, "dist")
2 changes: 1 addition & 1 deletion packaging/rubygems/lefthook.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |spec|
spec.name = "lefthook"
spec.version = "1.7.7"
spec.version = "1.7.8"
spec.authors = ["A.A.Abroskin", "Evil Martians"]
spec.email = ["lefthook@evilmartians.com"]