martinvonz / jj

A Git-compatible VCS that is both simple and powerful
https://martinvonz.github.io/jj/
Apache License 2.0
8.73k stars 300 forks source link

BUG: Working copy lock was dropped without being closed - "File exists" error on case-insensitive file system #1955

Open maccam912 opened 1 year ago

maccam912 commented 1 year ago

Description

I am on a case insensitive filesystem, and in a branch I'm working on a file has been renamed to include only lower-case characters. I am trying to rebase this branch onto another branch which has changes in the file, but also still has its previous name containing upper-case characters. Running jj workspace update-stale hits the same bug and doesn't fix the issue.

The actual error here is: BUG: Working copy lock was dropped without being closed. Internal error: Failed to check out commit 999602ae65501dfdc072abc0f588010473059abc: Failed to open file /path/to/Data_manager.py for writing: Os { code: 17, kind: AlreadyExists, message: "File exists" }

Steps to Reproduce the Problem

  1. Be on a case-insensitive file system (I'm using Macos APFS)
  2. Create a branch, do some changes to a test file in both branches to trigger a conflict.
  3. rename the test file with git mv ... to change capitalization somehow on the new branch.
  4. rebase onto the original branch with the non-renamed file.

Expected Behavior

I expect conflicts to be managed the same way they normally are, and no bugs to break jj

Actual Behavior

jj hits a BUG: Working copy lock was dropped without being closed. There is an error: "File exists". Running the suggested jj workspace update-stale hits the same bug.

Specifications

martinvonz commented 1 year ago

Thanks for the report. We know that case insensitive file systems are not supported well yet. Let's keep this bug open for tracking that. I don't even have a good workaround for you, unfortunately, other than just using git for it.

Also, jj doesn't support renames, so if you rebase changes to Data_manager.py onto a commit where it is called data_manager.py, then you're going to get a conflict between the changes in Data_manager.py and the deletion, and you're going to have to manually copy over the changes to the data_manager.py and delete Data_manager.py.