Skip to content

BF: Replace backslashes in file paths when commiting changes#78

Merged
TEParsons merged 1 commit intopsychopy:releasefrom
TEParsons:release-bf-windows-paths
Apr 20, 2026
Merged

BF: Replace backslashes in file paths when commiting changes#78
TEParsons merged 1 commit intopsychopy:releasefrom
TEParsons:release-bf-windows-paths

Conversation

@TEParsons
Copy link
Copy Markdown
Contributor

@TEParsons TEParsons commented Apr 16, 2026

@aforren1 and I are still trying to get to the bottom of why this matters, the isomorphic git documentation doesn't say anything to suggest it should, but it seems to break (sometimes) when filepaths have Windows-style slashes in

@TEParsons
Copy link
Copy Markdown
Contributor Author

TEParsons commented Apr 16, 2026

@aforren1 I've been able to replicate your error! The thing I was missing is that there needs to be a subfolder in the file path for it to break. I was testing by making an experiment and just sticking a conditions file and some stimuli in the same folder, but they need to be in a subfolder. It seems that the style of file path for files has to match the style of filepath for the git folder; I just made a project with a stimulus 2 folders deep, then put in console.log(folder, file) just before the changed line in this PR and got:

W:/My Drive/Throwaway/testWinpathSync stimuli\subfolder\test.jpg

So the git project folder is always supplied from the front end with /, but the file path is supplied from fs with \, and combining the two seems to be the problem. When the stimulus is in the same folder as the experiment, this doesn't matter as the file path doesn't have any slashes in anyway.

Now that I can recreate the error, I can confirm that replacing the \ with / reliably fixes it. Thanks for your help debugging!

@aforren1
Copy link
Copy Markdown
Contributor

Thanks @TEParsons! The other thing that came to mind was maybe differences in git core.autocrlf settings (does isomorphic git even see the user's git configs?), but glad that works.

@TEParsons
Copy link
Copy Markdown
Contributor Author

Seeing as their GitConfigManager only reads and writes to the repo's config file I would guess it doesn't have access to global user config

@TEParsons TEParsons merged commit 71458e9 into psychopy:release Apr 20, 2026
1 check passed
@TEParsons TEParsons deleted the release-bf-windows-paths branch April 20, 2026 12:51
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