Skip to content

Releases: CivNode/diff3-go

Release list

v0.1.1

Choose a tag to compare

@christerso christerso released this 19 Apr 13:10

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 editScript and Diff. The foundD < 0 fallback, the emit empty-slice guard, and the getV d < 0 sentinel 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 .gitattributes rule (testdata/fixtures/** -text) now prevents git from normalizing fixture files on checkout. The crlf-mix fixture was rebuilt with actual \r\n bytes in b.txt and expected.txt, so it tests what its name claims. A testdata/fixtures/README.md documents the CRLF design decision and the dual-coverage approach (fixture + programmatic crlf_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

Choose a tag to compare

@christerso christerso released this 19 Apr 12:59

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 markers
  • LineAware mode (default) and CharacterAware mode 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)