Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --irreversible-delete to git diff in patch-commit #5003

Closed
1 task done
webstrand opened this issue Jul 10, 2022 · 2 comments · Fixed by #5008
Closed
1 task done

Add --irreversible-delete to git diff in patch-commit #5003

webstrand opened this issue Jul 10, 2022 · 2 comments · Fixed by #5008
Milestone

Comments

@webstrand
Copy link
Contributor

Describe the user story

When deleting files from a package under pnpm patch it is not desirable to retain the full contents of the deleted file in the resulting patch file created by pnpm patch-commit it wastes repository space and can be confusing when fixing up a patch that failed to apply.

Describe the solution you'd like

Add --irreversible-delete to /packages/plugin-commands-patching/src/patchCommit.ts:64 so that the patches do no retain the full contents of the deleted file.

Describe the drawbacks of your solution

As far as I know, there are no drawbacks. The contents of any deleted file are retained by the package repository.

Describe alternatives you've considered

Manually editing the resulting patch files is finicky and it's easy to break the patches.

@zkochan
Copy link
Member

zkochan commented Jul 10, 2022

Sounds good to me, I wonder why Yarn is not doing the same

cc @arcanis

@arcanis
Copy link

arcanis commented Jul 11, 2022

Sounds good to me, I wonder why Yarn is not doing the same

Seems a good idea - we just didn't realize the rm operation was including the old content, which isn't super useful indeed 🤔

zkochan pushed a commit that referenced this issue Jul 11, 2022
Avoid retaining a copy of the contents of files deleted during patching

close #5003
@zkochan zkochan added this to the v7.5 milestone Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants