feat(jj): implement file_restore and warn on unsupported staging ops#194
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Implements missing Jujutsu (jj) support for restoring files from a given revision and improves UX by warning (once) when users invoke Git-style staging operations that jj doesn’t support, addressing issue sindrets#562.
Changes:
- Implement
JjAdapter.file_restore()usingjj restore --from …and refresh any open buffer after restoration. - Add
_warn_once()and convert staging APIs (add_files,reset_files,stage_index_file) into warning no-ops that return success to avoid misleading “Failed to stage/unstage” errors. - Extend functional coverage for the new warning coalescing, staging no-ops, and
file_restore(including an integration test).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| README.md | Notes that staging-related actions are Git concepts and are no-ops for jj. |
| lua/diffview/vcs/adapters/jj/init.lua | Adds _warn_once, implements file_restore, and makes staging methods warn-and-no-op for jj. |
| lua/diffview/tests/functional/jj_adapter_spec.lua | Adds tests for _warn_once, staging no-ops behavior, and file_restore (unit + integration). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
e76f3cf to
7c08d34
Compare
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
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.
Relates to sindrets#562.