Building from source
Get the source
Section titled “Get the source”git clone https://github.com/bapatchirag/revision.gitcd revisionYou need a Go toolchain matching the version in
go.mod, and svn on your
PATH to run the integration tests.
make build # compiles ./bin/revisionmake testmake build produces a development build: it reports the version git describe gives
and never self-updates, because the release channel is
stamped in by the release pipeline alone.
Make targets
Section titled “Make targets”| Target | What it does |
|---|---|
make build |
Compile ./bin/revision. |
make run |
Run the TUI from source. |
make run-gallery |
Preview the reusable components in isolation. |
make test |
Run all tests. |
make cover |
Run tests with a coverage summary. |
make vet |
Run go vet. |
make lint |
Run golangci-lint (must be installed separately). |
make fmt |
gofmt the tree. |
make tidy |
Tidy go.mod / go.sum. |
make cross |
Build static binaries for every release target. |
make clean |
Remove build artifacts. |
Cross-compiling
Section titled “Cross-compiling”make crossThat writes one static binary per release target:
dist/revision-darwin-arm64dist/revision-darwin-amd64dist/revision-linux-amd64dist/revision-linux-arm64These are the four targets the install script serves; make build-darwin-arm64 and its three siblings build them one at a time. Locally
cross-compiled binaries are still development builds — the release channel is stamped in
by the release pipeline, not by make cross.
Running it
Section titled “Running it”./bin/revision --path /path/to/working-copyOr make run, which builds and starts it in the current directory.
The component gallery
Section titled “The component gallery”make run-gallerycmd/gallery renders every reusable component from internal/tui/component on its own,
without any SVN data. It is the fastest way to see a component change — no working copy
required.
make testSome tests drive a real svn binary against a throwaway repository created with
svnadmin. They skip automatically when svn and svnadmin are not on the PATH, so
the suite passes on a machine without Subversion — it just covers less.
Golden tests compare rendered output byte for byte. Regenerate them after an intentional UI change:
go test ./... -updateRead the diff before committing regenerated goldens. An unexpected file in that diff means the change reached further than intended.
Before opening a PR
Section titled “Before opening a PR”make fmt && make lint && make testSee Contributing.