Skip to content

feat(jj): implement file_restore and warn on unsupported staging ops#194

Merged
dlyongemallo merged 1 commit into
mainfrom
jj_file_restore
May 21, 2026
Merged

feat(jj): implement file_restore and warn on unsupported staging ops#194
dlyongemallo merged 1 commit into
mainfrom
jj_file_restore

Conversation

@dlyongemallo
Copy link
Copy Markdown
Owner

@dlyongemallo dlyongemallo commented May 21, 2026

Relates to sindrets#562.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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() using jj 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.

Comment thread lua/diffview/vcs/adapters/jj/init.lua
Comment thread lua/diffview/tests/functional/jj_adapter_spec.lua
@dlyongemallo dlyongemallo merged commit 85d75ba into main May 21, 2026
7 checks passed
@dlyongemallo dlyongemallo deleted the jj_file_restore branch May 21, 2026 04:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants