Repository navigation
refactor: drop the patched libgit2-sys and quote rename names before parsing - #2
Merged
Merged
Conversation
…parsing Stock libgit2 cuts unquoted rename and copy names at whitespace. Rewrite those header names into Git's quoted form, which libgit2 decodes exactly, and map parser offsets back to the supplied patch. A build script keeps rejecting LIBGIT2_NO_VENDOR so a system libgit2 is never linked. Also update the yanked clipboard-win 5.4.1 to 5.4.3.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removes
vendor/libgit2-sysand its[patch.crates-io]entry. The build now uses the publishedlibgit2-sys 0.18.8+1.9.7(checksum matches the original crate recorded in the old patch note).What replaces the patch
Stock libgit2 stops an unquoted
rename from/toorcopy from/toname at the first whitespace byte.src/model/rename_names.rsrewrites only those header names, inside adiff --gitextended header, into Git's C-quoted form, which libgit2 decodes exactly. Hunk lines are never touched, and parser content offsets are mapped back to the supplied bytes, so line numbers, source offsets and source context are unchanged (the existingParser source offset does not match the supplied patchcheck still guards every line).Names libgit2 already reads correctly, quoted names, and empty names are left as written; malformed quoted names remain errors. Patches without a
rename/copyline skip the pass after amemmemcheck.The other half of the old patch, refusing a system libgit2, moves to a crate
build.rsthat rejects a nonzeroLIBGIT2_NO_VENDOR. A unit test assertsgit2::Version::get().vendored().Also
cargo update -p clipboard-win(5.4.1 is yanked → 5.4.3). The only other lockfile change islibgit2-sysgaining its registry source and checksum.Checks
cargo fmt --check; clippy-D warningsfor default,--all-features, and--lib --no-default-features.cargo test --release --locked -- --test-threads=1: 255 passed, 0 failed, 10 ignored; embedded host contract: 6 passed.diff --githeader consistency, equivalence with Git's quoted spelling, multi-file offset mapping. Two of them fail with the rewrite disabled.inspectJSON is byte-identical to themainbuild for all five DiffsHub corpus patches, the repository fixtures, and a linux v6-v7 variant where all 7,480 rename/copy names gained interior and trailing spaces.tools/parse_baseline.py, 3 runs each, main vs this branch: no time or peak-RSS regression (linux v6-v7 median 5.72 s / 385 MiB vs 5.38 s / 382 MiB).