Repository navigation
Releases: CivNode/diff3-go
Release list
v0.1.1
v0.1.1
Changes
-
go.mod aligned with CI: minimum Go version lowered from 1.26.1 to 1.22, matching the CI workflow. No 1.26-only features were in use; this prevents silent divergence between local and CI builds.
-
internal/myers: 100% statement coverage: three unreachable dead guards removed from
editScriptandDiff. ThefoundD < 0fallback, theemitempty-slice guard, and thegetV d < 0sentinel were all provably unreachable given Myers algorithm invariants. Removing them makes coverage honest and the invariant proofs are now in comments rather than silent dead branches. -
crlf-mix fixture: real CRLF bytes: a
.gitattributesrule (testdata/fixtures/** -text) now prevents git from normalizing fixture files on checkout. Thecrlf-mixfixture was rebuilt with actual\r\nbytes inb.txtandexpected.txt, so it tests what its name claims. Atestdata/fixtures/README.mddocuments the CRLF design decision and the dual-coverage approach (fixture + programmaticcrlf_test.go). -
BenchmarkMerge2MB: true 2 MB input: generator row count corrected from 26000 (~1.5 MB) to 34562 (2.000 MB). README benchmark table updated with fresh numbers from the same hardware.
Historical note
Commit 63680fb contains an em dash in its subject line. Git history is append-only and v0.1.0 is already tagged; that commit stands as-is. All v0.1.1 commits use hyphens.
Coverage
| package | statements |
|---|---|
github.com/CivNode/diff3-go |
99.4% |
github.com/CivNode/diff3-go/internal/myers |
100.0% |
| total | 99.6% |
v0.1.0
First release.
What is included:
Merge(ancestor, a, b string, opts Options) (result string, hadConflicts bool, err error)— three-way merge with Git-style conflict markersLineAwaremode (default) andCharacterAwaremode for sub-line resolution- Custom conflict marker strings
- 10 golden-file test fixtures covering clean merges, add/modify/delete conflicts, CRLF, empty ancestor, unicode
- Property tests: idempotent, symmetric, trivial cases
- Compact Myers diff with O(D^2) trace storage (not O(N*D))
- 95.7% line coverage across all packages; 99.4% on the merge engine
Known limitations (see README):
- CRLF and LF are treated as distinct characters
- No whitespace-ignore mode
- Performance degrades on high-conflict inputs (O(N*D) time)