Repository navigation
WIP: winx4-patch — shred data-loss + patch -p/context/normal formats - #1389
Merged
Merged
Conversation
caomengxuan666
marked this pull request as ready for review
October 26, 2026 12:21
caomengxuan666
force-pushed
the
fix/winx4-patch
branch
from
October 26, 2026 14:22
160257c to
cf8db7a
Compare
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.
Fixes #1348
Fixes #1345
Fixes #1346
Refs #1364
Cluster: winx4-patch (REPORT: workspace winuxcmd-fix/clusters/winx4-patch/REPORT.md).
--remove=wipedeletes an unrelated constant-named file and leaves the target in place (data loss);-ssize semantics diverge #1348 (shred, DATA LOSS):--remove=wiperenamed the target to a hardcoded constant name, unchecked — an innocent same-name file in the directory was deleted while the target survived, rc 0 silently. Now: fresh CSP-random 16-char name per file with collision retry, MoveFileW result checked (failure = rc 1, nothing deleted), deletion result checked. Sentinel regression included (pre-seededf6d4b2907e5c3a1="keepme" must survive). Also-sexact-size with the full GNU suffix grammar measured against coreutils 9.4, and-n -1rejected rc 1 with GNU wording.-p/--stripis parsed but never applied — patch always strips 0 components #1345 (patch):-p/--stripwas read with the wrong typed getter and always fell back to strip 0; now reads the int value, negative rejected rc 2 per GNU; patch added to the dispatcher's parse-error exit-2 list.read_file_rawnow resolves operands through the shared native_path boundary (bare/no longer lands on the drive root). Same-filefile_exists/write_file_raw/backup_fileintentionally left for the rootaudit full-set integration pass.Integration (2026-10-26): rebased onto current main (
2fe219f9, after #1387/#1388/#1395 landed). The only conflict wastests/unit/patch/patch_unit_test.cpp— both sides had appended tests at EOF (main's #1374 glob test vs this branch's #1345 tests); resolved by keeping both (23 TESTs, braces balanced, each side's additions verified as pure insertions against both parents).patch.cpp/dispatcher.cppmauto-merged; the #1374 glob-expansion change and this branch's changes are both present.Verification: Windows CI on the pre-rebase head was fully green (x64/arm64/compare/oracle); CI re-runs on the rebased head. The local mingw+Wine probe battery (
harness/probes.sh, 86 lines) is still outstanding — the local Wine environment is currently broken at the wineserver/binfmt layer (reproduced across clusters, not code-related); the battery remains the first follow-up once the environment heals, and any probe failure will be fixed on a follow-up PR against these commits.i18n: companion PR unixwin/winuxcmd-i18n#11 (drops the 2 stale invalid-strip-count keys removed by the #1345 fix) merges after i18n #12 (0.6.22) and #9 (0.6.23), taking VERSION 0.6.24, per the current version queue.