A Zig library that reads git repositories without running git, with log, show and diff output byte-identical to git's.

diff: split a search past 256 steps early as git does

Past step 256 of a search for a middle snake (only a comparison of more than 65,532 lines gets there) git splits the box early. Black-box probes of git pinned the rule: on a step where either search found a snake of 21 lines or more (a trigger, however close to its corner), the box is split at a snake of 20 or more lines found on that step that ends more than twice as many lines from its search's corner, in each text, as the steps taken; the forward search's furthest out in the nearer text if it has one, else the backward search's. A lone 20-line snake never splits, a trigger from the step before or after does not count, and a trigger the margin rules out still does. Refused instead, where git was not seen to follow the rule or the order of its choices is not known: a step with two triggers or two snakes as far out as each other, a box whose two searches both found a trigger far enough out in the 16 steps before step 257, an early split on the give-up step, one due on a step whose backward search then meets the forward one elsewhere, and any search past 256 steps in a range --patience or --histogram hands back. The two Ghostty commits updating its vendored simdutf, refused before, now match git byte for byte. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01P9FTtTrkEbuvbZnRyJCBir


Author jcollie.dev
Co-author Claude Opus 5.5 Date Commit Parent 802cc24b