-
Notifications
You must be signed in to change notification settings - Fork 605
discard changes: hunk selections #7807
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
Conversation
@Byron is attempting to deploy a commit to the GitButler Team on Vercel. A member of the Team first needs to authorize it. |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Hi @estib-vega, I noticed you have been dealing with hunk selections lately, so here is an example on how hunk-selections work for discard (but committing will be the same): gitbutler/crates/but-workspace/tests/workspace/discard/hunk.rs Lines 368 to 384 in 47b86e1
The idea is that discarding added lines anchors the selection on the old patch header, and vice-versa. If there are any questions, please let me know :). |
@krlvi I think this can be merged and hooked up the UI right away. However, please note the intentional limitation of refusing to discard hunks when the whole file was added or deleted (see "Notes for the Reviewer" for details). It should be no problem to allow it though if this is a requirement. |
Add V3 facilities for discarding changes in the worktree or index, this time it's about hunks specifically.
Follow-up of #7806.
Tasks
Notes for the reviewer
For the next PRs
Shortcomings
Out of Scope
Research
unapply_lines
,unapply_ownership
andreset_files