vcs-diff
Shared git-format unified-diff model and parser for the vcs-toolkit-rs workspace.
git diff and jj diff --git emit byte-identical output, so vcs-git and
vcs-jj share one parser here instead of each carrying a copy that could
silently drift. Dependency-free (std only) — pure data types and pure
functions, no process execution.
use ;
let diff = "diff --git a/f b/f\n--- a/f\n+++ b/f\n@@ -1 +1 @@\n-a\n+b\n";
for file in parse_diff
It also exposes [DiffStat] (the file/line aggregate both --shortstat and
--stat parse into) and [Version] + [parse_dotted_version] for reading a
<tool> --version banner.
The wrapper crates re-export these types, so vcs_git::FileDiff,
vcs_git::parse_diff, and vcs_git::GitVersion (an alias of vcs_diff::Version)
all resolve — you rarely name this crate directly.
Part of vcs-toolkit-rs; used by
vcs-git, vcs-jj, and vcs-core.
License
MIT