Skip to content
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

windows: jj breaks on 'fake symlinks' generated by git #3164

Open
jyn514 opened this issue Feb 28, 2024 · 4 comments
Open

windows: jj breaks on 'fake symlinks' generated by git #3164

jyn514 opened this issue Feb 28, 2024 · 4 comments

Comments

@jyn514
Copy link
Collaborator

jyn514 commented Feb 28, 2024

Description

PS C:\Users\jyn\src\dotfiles> jj diff
ignoring symlink at \\?\C:\Users\jyn\AppData\Local\Temp\jj-diff-5II3rq\left\bin\ddg
Error: Failed to generate diff
Caused by:
1: Failed to write directories to diff
2: Failed to stat file \\?\C:\Users\jyn\AppData\Local\Temp\jj-diff-5II3rq\left\bin\ddg
3: The system cannot find the file specified. (os error 2)

mingw file shows that bin/ddg is a normal text file:

jyn@DESKTOP-TN36JV8 MINGW64 ~/src/dotfiles (master)
$ file bin/ddg
bin/ddg: ASCII text, with no line terminators

jyn@DESKTOP-TN36JV8 MINGW64 ~/src/dotfiles (master)
$ cat bin/ddg
ducker

Steps to Reproduce the Problem

i am not quite sure how to replicate this; i think you would have to create the symlink on linux, push it to a remote, and then clone it from windows with core.symlinks=false set.

Expected Behavior

jj doesn't exit with an error.

Specifications

  • Platform: Windows 11
  • Version: 0.14.0
@jyn514
Copy link
Collaborator Author

jyn514 commented Feb 28, 2024

i think the reason jj thinks the symlink has been modified in the first place is because it doesn't respect git's core.autocrlf setting (i have it set to false) #53

@martinvonz
Copy link
Owner

Since #2996, we should at least preserve the symlink by writing them as regular files (we used to panic). The open PR #2939 adds support for writing symlinks as real symlinks when possible.

Do you clone the repo with jj git clone or regular git clone? More directly, did git or jj write the working copy? Is the issue when git has written a real symlink there and jj then tries to snapshot it?

@jyn514
Copy link
Collaborator Author

jyn514 commented Feb 28, 2024

i cloned this with git clone. i assume that means git wrote the working copy.

snapshotting seems to be ok? jj status succeeds at least (it shows almost every file as modified though, because of CRLF issues). it's just jj diff that errors out.

@yuja
Copy link
Collaborator

yuja commented Feb 29, 2024

Error: Failed to generate diff

This message suggest that jj diff tries to set up snapshot directories for external diff tool, which uses the same machinery as the regular working copy. So I think #2996 would fix the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants