Skip to content

chore(deps): bump github.com/sergi/go-diff from 1.4.0 to 1.4.5 - #12

Open
dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/go_modules/github.com/sergi/go-diff-1.4.5
Open

dependabot[bot] wants to merge 1 commit into
mainfrom
dependabot/go_modules/github.com/sergi/go-diff-1.4.5

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Nov 23, 2026

Copy link
Copy Markdown
Contributor

Bumps github.com/sergi/go-diff from 1.4.0 to 1.4.5.

Release notes

Sourced from github.com/sergi/go-diff's releases.

v1.4.5

Bug fixes:

  • PatchApply, PatchSplitMax and PatchAddContext now slice text on UTF-8 rune boundaries. Patches built from or applied to text with multi-byte characters no longer panic with "slice bounds out of range" and always produce valid UTF-8 (#132, #155).
  • Applying a patch to a text that has changed no longer panics when earlier edits leave the text shorter than the later insert and delete positions expect; positions are clamped to the text, as substring does in the reference implementation. This could panic on plain ASCII text.
  • A patch whose context ends inside a multi-byte rune no longer places an insertion one rune early while still reporting success.

Behavior:

  • PatchMake → PatchApply round trips are unchanged, including for multi-byte text. Applying a patch to a changed multi-byte text differs in ambiguous fuzzy-match cases, where previous releases produced invalid UTF-8 or panicked. Verified with a randomized differential comparison of half a million patch applications against v1.4.4: no panics, no invalid UTF-8, and identical round-trip and ASCII results.

v1.4.4

Performance:

  • PatchSplitMax is up to 50x faster on large patches: it now reads only the few bytes of trailing context it needs instead of rebuilding the remaining patch text for every piece.
  • MatchBitap, and so fuzzy matching in MatchMain and PatchApply, is about 2x faster thanks to an array lookup in its inner loop.
  • PatchFromText is about 20% faster: the header regex is compiled once and each header is matched once.
  • Line-mode diffs of large texts allocate about half as much memory and run up to 39% faster, because the line tables are sized up front.

No API or behavior changes. New benchmarks cover MatchBitap, PatchFromText, PatchApply and PatchSplitMax.

v1.4.3

Hardening:

  • PatchFromText rejects patch headers with out-of-range coordinates instead of silently clamping them; clamped coordinates could apply a patch at a wrong location and report success.

Documentation:

  • Runnable examples for diffing, plain text output, line diffing, the full patch cycle, fuzzy matching and semantic cleanup.
  • Documented the checklines flag, the diff operations, and the unique-line limit of DiffLinesToChars and DiffLinesToRunes.
  • README: live CI badge, corrected install command and origins link, and a status statement.

Project:

  • CI runs on Linux (Go 1.13 and latest), macOS and Windows, plus govulncheck, on every push and pull request and weekly.
  • The Makefile lint and test targets work again; Travis and its dead config are gone.
  • Branch protection requires the test suite to pass before merging.
  • Fixed a timing-dependent DiffBisect test on coarse clocks, found by the new Windows CI.

v1.4.2

Bug fixes:

  • PatchMake no longer panics when the source text contains invalid UTF-8 (#157, #158).

v1.4.1

Bug fixes:

  • Semantic cleanup now detects blank lines at the start of the following text, matching upstream diff-match-patch.
  • Semantic lossless cleanup no longer miscounts multibyte characters when shifting edits.
  • PatchFromText returns an error on invalid %xx escapes instead of silently emptying the line.
  • Minor: DiffMainRunes no longer writes to the caller's rune slice; fixed DiffFromDelta and intToRune error messages.

Diff output from semantic cleanup may differ slightly for text with blank lines or non-ASCII characters.

Commits
  • 3069921 test: use utf8.ValidString in the rune-safety tests
  • 7f6d802 Merge pull request #155 from SnowWarri0r/pr1/fix-issue-132-rune-safe-slicing
  • ce0771e fix: round range ends outward and clamp indices in PatchApply
  • b2f00cc fix: rune-safe byte slicing in Patch{Apply,SplitMax,AddContext}
  • 22140c5 perf: remove avoidable allocations and repeated work in diff, match and patch
  • b559db2 ci: run govulncheck and a weekly build
  • 916526d docs: describe the diff operations and the checklines flag
  • f1e2884 docs: add runnable examples for the common tasks
  • e8a5652 docs: describe go-diff as finished and actively maintained
  • 375295f test: use an unambiguously expired deadline in the DiffBisect timeout case
  • Additional commits viewable in compare view

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [github.com/sergi/go-diff](https://github.com/sergi/go-diff) from 1.4.0 to 1.4.5.
- [Release notes](https://github.com/sergi/go-diff/releases)
- [Commits](sergi/go-diff@v1.4.0...v1.4.5)

---
updated-dependencies:
- dependency-name: github.com/sergi/go-diff
  dependency-version: 1.4.5
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot Bot added dependencies Pull requests that update a dependency file go Pull requests that update go code labels Nov 23, 2026
@cloudflare-workers-and-pages

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Failed ❌

View logs ↗
88f8a53 2026-11-23T16:18:24.176Z View logs ↗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file go Pull requests that update go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants