-
Notifications
You must be signed in to change notification settings - Fork 341
feat: Add reset file commands to compare view (#3) #2079
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
Closed
Closed
+275
−18
Conversation
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
* Add reset file commands to compare view Enable "Reset to Parent Revision" and "Reset to This Revision" commands in the compare view when selecting two commits. These commands now work for both single and multiple file selections in the compare view. - Add ResetToSourceRevisionAsync and ResetToTargetRevisionAsync methods - Add ResetMultipleToSourceRevisionAsync and ResetMultipleToTargetRevisionAsync methods - Update RevisionCompare constructor to accept Repository object for logging - Add CanResetFiles property to check if reset operations are available - Add reset menu items to context menu in RevisionCompare view - Parent Revision resets to compare source (StartPoint) - Current Revision resets to compare target (EndPoint) * Fix reset file commands for deleted files in compare view When resetting a file to a revision where it is deleted, use 'git rm' instead of 'git checkout' to properly remove the file from both the working directory and the index. - Add new Remove command for git rm operations - Update ResetToSourceRevisionAsync to handle Added files (don't exist in source) - Update ResetToTargetRevisionAsync to handle Deleted files (don't exist in target) - Update multiple file reset methods to separate files into checkout vs remove lists - Pass Change object instead of just path string to enable state checking - Use --force and --ignore-unmatch flags for robust file removal Fixes the "pathspec did not match any file(s) known to git" error when trying to reset deleted files to the revision where they are deleted. * Apply deleted file fix to single commit view reset commands Apply the same deleted/added file handling to CommitDetail (single commit view) that was previously applied to RevisionCompare. - Update ResetToThisRevisionAsync to handle Deleted files - Update ResetToParentRevisionAsync to handle Added files - Update ResetMultipleToThisRevisionAsync to separate deleted files - Update ResetMultipleToParentRevisionAsync to separate added files - Change method signature to accept Change object instead of path string - Update all call sites to pass Change object instead of path This fixes the same "pathspec did not match any file(s) known to git" error when resetting deleted files in single commit view. --------- Co-authored-by: Claude <noreply@anthropic.com>
love-linger
added a commit
that referenced
this pull request
Jan 29, 2026
…etails panel (#2079) Better handle for `added/deleted/renamed` file changes Co-authored-by: ybeapps <ybeapps@gmail.com> Signed-off-by: leo <longshuang@msn.cn>
Collaborator
|
I picked and modified the optimizations for the |
love-linger
added a commit
that referenced
this pull request
Jan 29, 2026
…etails panel (#2079) Better handle for `added/deleted/renamed` file changes Co-authored-by: ybeapps <ybeapps@gmail.com> Signed-off-by: leo <longshuang@msn.cn>
love-linger
added a commit
that referenced
this pull request
Jan 29, 2026
…cted change(s) in revision compare view (#2079) Co-authored-by: ybeapps <ybeapps@gmail.com> Signed-off-by: leo <longshuang@msn.cn>
Collaborator
|
I've pushed my implemetation for this feature |
Contributor
Author
|
Cool do you want me to test it? What is the next step |
Collaborator
|
I'm very glad that you can help testing it. |
love-linger
added a commit
that referenced
this pull request
Jan 29, 2026
…cted change(s) in compare view (#2079) Signed-off-by: leo <longshuang@msn.cn>
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.
Add reset file commands to compare view
Enable "Reset to Parent Revision" and "Reset to This Revision" commands in the compare view when selecting two commits. These commands now work for both single and multiple file selections in the compare view.
also - fixed a bug for Added files and Removed files that had an error
pathspec did not match any file(s) known to git