Skip to content

feat: add restore file from files_tab#182

Merged
dotdash merged 1 commit into
Cretezy:mainfrom
Edgpaez:restore-file
Dec 15, 2025
Merged

feat: add restore file from files_tab#182
dotdash merged 1 commit into
Cretezy:mainfrom
Edgpaez:restore-file

Conversation

@Edgpaez

@Edgpaez Edgpaez commented Nov 23, 2025

Copy link
Copy Markdown
Contributor

First of all, thank you for the time and effort you've put into lazyjj !

This implements the equivalent to jj restore file.
I tried to follow #146.
I have been using daily a fork with this commit for over a week and found no problems with it

This includes the change from #183 to send the path with path: so errors don't occur for paths with :

Happy to change based on feedback :)

@Edgpaez
Edgpaez force-pushed the restore-file branch 2 times, most recently from fa7e75b to f0db3a0 Compare November 23, 2025 21:22
@Edgpaez
Edgpaez force-pushed the restore-file branch 2 times, most recently from 6596b69 to 1acfccf Compare December 3, 2025 22:37
Comment thread src/commander/files.rs
path
};

let fileset = format!("file:\"{}\"", path.replace('"', "\\\""));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I also changed this so files with double quotes can be restored.

@dotdash

dotdash commented Dec 7, 2025

Copy link
Copy Markdown
Collaborator

Nice, but When showing files from a different rev than @, this should either pass in that revision using the --changes-in option, or there should be a safe guard against running it on revisions other than @.

@Edgpaez

Edgpaez commented Dec 9, 2025

Copy link
Copy Markdown
Contributor Author

thanks again for reviewing @dotdash.
as far as I can see, the files tab always shows the changes from @: https://github.com/Cretezy/lazyjj/blob/main/src/app.rs#L109-L113

It seems like this was not always the case... and I can see the value in showing it for the selected rev. Maybe we can address that in another PR? we would also need to safe guard untrack and any other commands we want to run on a file.

@dotdash

dotdash commented Dec 15, 2025

Copy link
Copy Markdown
Collaborator

thanks again for reviewing @dotdash. as far as I can see, the files tab always shows the changes from @: https://github.com/Cretezy/lazyjj/blob/main/src/app.rs#L109-L113

Pressing Enter (default binding) in the log view shows the files for the highlighted change:

ComponentAction::ViewFiles(head) => {

It seems like this was not always the case... and I can see the value in showing it for the selected rev. Maybe we can address that in another PR? we would also need to safe guard untrack and any other commands we want to run on a file.

True.

@dotdash
dotdash merged commit f4b436f into Cretezy:main Dec 15, 2025
10 checks passed
@Edgpaez
Edgpaez deleted the restore-file branch January 10, 2026 02:48
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.

3 participants