Use go-git for native git operations

Replace exec-based git calls with go-git/v6 library for ~5.6x
speedup over shell version. Only pgrep remains as external call.
This commit is contained in:
2025-12-18 05:11:34 +01:00
parent 135bbf68f1
commit f1ca1ccaa0
4 changed files with 383 additions and 43 deletions

22
go.mod
View File

@ -2,4 +2,24 @@ module github.com/kjanat/claude-statusline
go 1.24.11
require golang.org/x/sys v0.39.0
require (
github.com/go-git/go-git/v6 v6.0.0-20251216093047-22c365fcee9c
golang.org/x/sys v0.39.0
)
require (
github.com/Microsoft/go-winio v0.6.2 // indirect
github.com/ProtonMail/go-crypto v1.3.0 // indirect
github.com/cloudflare/circl v1.6.1 // indirect
github.com/cyphar/filepath-securejoin v0.6.1 // indirect
github.com/emirpasic/gods v1.18.1 // indirect
github.com/go-git/gcfg/v2 v2.0.2 // indirect
github.com/go-git/go-billy/v6 v6.0.0-20251209065551-8afc3eb64e4d // indirect
github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect
github.com/kevinburke/ssh_config v1.4.0 // indirect
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
github.com/pjbgf/sha1cd v0.5.0 // indirect
github.com/sergi/go-diff v1.4.0 // indirect
golang.org/x/crypto v0.46.0 // indirect
golang.org/x/net v0.48.0 // indirect
)