feat: add apply --force flag and rename --no-apply to --save-only#33
Merged
mikolalysenko merged 5 commits intomainfrom Mar 4, 2026
Merged
feat: add apply --force flag and rename --no-apply to --save-only#33mikolalysenko merged 5 commits intomainfrom
mikolalysenko merged 5 commits intomainfrom
Conversation
Add --force/-f flag to `apply` command that skips pre-application hash verification, allowing patches to be applied even when the installed package version differs from what the patch targets. When force is enabled, hash mismatches are treated as ready-to-patch and missing files (for non-new entries) are skipped rather than aborting. Rename `get --no-apply` to `get --save-only` for clarity, with `--no-apply` kept as a backward-compatible alias. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…n swap npm test: Swapping to minimist@1.2.5 changes the PURL version so the crawler never matches the manifest key — apply returns success without reaching the hash check. Instead, corrupt the file content in-place. pypi test: The pydantic-ai patch variant may have files with empty beforeHash (new files). Dynamically find a file with a non-empty beforeHash to corrupt. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…Hash) The pydantic-ai@0.0.36 patch treats all files as new (empty beforeHash), so hash mismatch cannot occur. The --force feature is covered by the npm e2e test and 2 unit tests in apply.rs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
--force/-fflag toapplycommand that skips pre-application hash verification, allowing patches to be applied even when the installed package version differs from what the patch targetsget --no-applytoget --save-onlyfor clarity, keeping--no-applyas a backward-compatible alias--forceis enabled:HashMismatchfiles are patched anyway,NotFound(non-new) files are skipped instead of aborting--forceby skipping the pre-check that filters variants by hashTest plan
cargo test --workspace)test_apply_package_patch_force_hash_mismatch,test_apply_package_patch_force_not_found_skipscargo clippy --workspace -- -D warningsclean--ignored):test_npm_save_only— verifies--save-onlysaves manifest without applyingtest_npm_apply_force— installs minimist@1.2.2, saves patch, reinstalls @1.2.5, verifies normal apply fails then--forcesucceedstest_pypi_save_only— verifies--save-onlyfor PyPI patchestest_pypi_apply_force— corrupts a file to create hash mismatch, verifies normal apply fails then--forcesucceeds🤖 Generated with Claude Code