Skip to content

fix: send file paths as filesets#183

Merged
dotdash merged 1 commit into
Cretezy:mainfrom
Edgpaez:fix-diff
Dec 7, 2025
Merged

fix: send file paths as filesets#183
dotdash merged 1 commit into
Cretezy:mainfrom
Edgpaez:fix-diff

Conversation

@Edgpaez

@Edgpaez Edgpaez commented Nov 23, 2025

Copy link
Copy Markdown
Contributor

Thanks again for the time and effort you've put into lazyjj !

This fixes an error where if a path contains : jj tries to parse it as a fileset. The error is this:

Error: Failed to parse fileset: Syntax error
Caused by: --> 1:1
|
1 | :hola
| ^---
|
= expected <strict_identifier>, <bare_string>, or
Hint: See https://jj-vcs.github.io/jj/latest/filesets/ or use jj help -k filesets for filesets syntax and how to match file paths.

This fixes it by prefixing the path with path: so it "Matches cwd-relative path prefix (file or files under directory recursively.)"
I have been using daily a fork with this commit for over a week and found no problems with it

Comment thread src/commander/files.rs Outdated
};

let mut args = vec!["diff", "-r", head.commit_id.as_str(), path];
let fileset = format!("file:\"{}\"", path);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Would this break with filenames containing double quotes?

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.

Thank you!
Yes it did break if a file contained double quotes. I fixed it now 👍

@dotdash
dotdash merged commit 83f60ce into Cretezy:main Dec 7, 2025
10 checks passed
@Edgpaez
Edgpaez deleted the fix-diff 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