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

Teach git add --patch to optionally stash a hunk, or drop it from the worktree without stashing #1828

Open
dscho opened this issue Nov 14, 2024 · 0 comments

Comments

@dscho
Copy link
Member

dscho commented Nov 14, 2024

Originally requested on the Git mailing list, in a reply Jeff King sketched how this would have been implemented in the Perl version of git add -p.

In the meantime, git add -p is a built-in, therefore it will be slightly more involved.

In particular, while the Perl variant seems to have staged changes immediately, the pure C version reassembles a single patch per file and applies that. The Perl variant is no more, therefore the C version would need to be patched. And there, that the paradigm would have to be extended so that an optional "reassemble-and-stash" or "reassemble-and-discard" step would precede that "reassemble-and-stage" phase.

Not the easiest project, but probably Outreachy/Google Summer of Code-sized.

I have pushed a very rudimentary sketch to my add-p-stash-mode branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant