This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
Multi-repository git operations library. Parallel status checks, sequential push/pull (for SSH passphrase prompts), error handling with stderr capture.
Module: forge.lthn.ai/core/go-git
Go: 1.26+
go test ./... -v # Run all tests
go test -run TestName # Run single test
golangci-lint run ./... # Lint (see .golangci.yml for enabled linters)Two files:
git.go— Core operations: Status, Push, Pull, PushMultiple. Stdlib only, no framework dependency.service.go— Core framework integration viadappco.re/go/core. Exposes query types (QueryStatus, QueryDirtyRepos, QueryAheadRepos) and task types (TaskPush, TaskPull, TaskPushMultiple). Service usescore.ServiceRuntimewith query/task handler registration inOnStartup. Also provides iterator methods (All, Dirty, Ahead) usingiter.Seq.
- Status is parallel (goroutine per repo), Push/Pull are sequential (SSH passphrase prompts need terminal interaction via stdin/stdout).
- All paths must be absolute. Service enforces WorkDir boundary via
validatePath. QueryStatusandStatusOptionsare structurally identical — cast directly between them.- Errors are wrapped as
*GitErrorwith captured stderr and command args.
_Good/_Badsuffix pattern for success / failure cases.- Tests use real git repos created by
initTestRepo()in temp directories. - Service helper tests (in
service_test.go) constructServicestructs directly without the framework. - Framework integration tests (in
service_extra_test.go) usecore.New()and test handler dispatch.
- UK English in comments
Co-Authored-By: Virgil <virgil@lethean.io>in commits- Conventional commits:
feat:,fix:,docs:,refactor:,chore:
git remote add forge ssh://git@forge.lthn.ai:2223/core/go-git.git