22
33This provides a Go Git CLI binary using ` go-git ` .
44
5+ ## Purpose
6+
7+ The CLI exposes key features from ` go-git ` so it can be assessed and tested
8+ against upstream Git on a like-for-like basis. Each subcommand is a thin
9+ wrapper over a ` go-git ` API, so the behaviour exercised by ` gogit <command> `
10+ is the behaviour that ` go-git ` consumers will see.
11+
12+ ## Bridging gaps in ` go-git `
13+
14+ When upstream Git tests require a feature that ` go-git ` does not yet
15+ expose, the gap is filled temporarily in ` internal/<package>/ ` . This
16+ directory is a staging area whose layout mirrors the eventual go-git
17+ home (e.g. ` internal/plumbing/format/idxfile ` is shaped for upstream's
18+ ` plumbing/format/idxfile ` ). Not everything that lives here belongs in
19+ ` go-git ` — some bits are test-only shims — but the layering keeps
20+ upstream tests that exercise the bulk of ` go-git ` unblocked while the
21+ upstreaming conversation is in progress.
22+
523## Installation
624
725``` bash
@@ -14,7 +32,41 @@ go install github.com/go-git/cli/cmd/gogit
1432gogit < command> [flags]
1533```
1634
35+ ## Conformance testing
36+
37+ ` make conformance ` runs a curated set of upstream Git tests against
38+ ` gogit ` , using upstream's own ` t/ ` harness. The runner
39+ (` conformance/run.sh ` ) builds ` gogit ` , symlinks it as ` git ` in a
40+ staging directory, and points ` GIT_TEST_INSTALLED ` there so the
41+ upstream framework picks our binary up unchanged.
42+
43+ The upstream test source comes from either:
44+
45+ - A local checkout pointed at by ` $GIT_SRC ` (e.g.
46+ ` GIT_SRC=$HOME/git/go-git/git make conformance ` ), or
47+ - A shallow clone of ` github.com/git/git ` 's default branch, re-fetched
48+ on every run so upstream behaviour drift surfaces immediately.
49+
50+ The set of curated tests is ` conformance/tests.txt ` — one filename per
51+ line, ` # ` comments are ignored:
52+
53+ ```
54+ t2008-checkout-subdir.sh
55+ t5308-pack-detect-duplicates.sh
56+ t5325-reverse-index.sh
57+ ```
58+
59+ Individual tests can be run directly:
60+
61+ ``` bash
62+ ./conformance/run.sh t2008-checkout-subdir.sh # one test, all cases
63+ ./conformance/run.sh t2008-checkout-subdir.sh 1,3 # one test, selected cases
64+ ```
65+
66+ ` $GO_GIT_REF ` (commit SHA, tag, or branch) overrides the ` go.mod ` pin
67+ for a single run so the gate can be evaluated against an in-flight
68+ ` go-git ` change.
69+
1770## License
1871
1972This project is licensed under the MIT License - see the [ LICENSE] ( LICENSE ) file for details.
20-
0 commit comments