Skip to content

feat: add --amend flag to carry over existing patch#7

Merged
nomyfan merged 2 commits into
mainfrom
feat/carry-over-existing-patch
May 23, 2026
Merged

feat: add --amend flag to carry over existing patch#7
nomyfan merged 2 commits into
mainfrom
feat/carry-over-existing-patch

Conversation

@nomyfan
Copy link
Copy Markdown
Owner

@nomyfan nomyfan commented May 23, 2026

Summary

  • Add --amend flag to p12y patch that applies an existing patch file to the new workspace, so users can continue editing from where they left off
  • Default behavior remains clean (no carry-over)
  • Patch application uses dry-run validation before real apply; recovery handles partial failures via git add . && git reset --hard HEAD && git clean -fdX

Test plan

  • Unit tests for find_existing_patch (found, not found, version mismatch)
  • E2E test: --amend carries over existing patch into new workspace
  • E2E test: default (no flag) starts clean
  • E2E test: bad patch with --amend recovers to clean state (no modified files, no .rej, no ignored residue)
  • All 27 tests pass, ruff + pyright clean

🤖 Generated with Claude Code

nomyfan and others added 2 commits May 23, 2026 12:45
When `p12y patch <package> --amend` is used and a matching patch file
exists in patches/, it is applied to the new workspace so users can
continue editing from where they left off. Default behavior remains
clean (no carry-over). Recovery handles partial failures via dry-run
validation followed by git add/reset/clean.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
uv hardlinks installed files to its cache by default. When users edit
files in the patch workspace, the hardlink causes the cache entry to
be modified too, corrupting subsequent installs of the same package.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@nomyfan nomyfan merged commit 0bd9604 into main May 23, 2026
18 checks passed
nomyfan added a commit that referenced this pull request May 25, 2026
Sync SKILL.md with PR #7 which added the --amend option to `p12y patch`.
Documents the flag in the command synopsis and in the standard workflow
section, including fallback behaviour when the patch cannot be applied.

Co-authored-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant