On Windows, pijul doesn’t consistently use \ as a directory separator. I’m not sure if there are other places like this, but path::components only accepts \ and is sometimes given /.
I don’t know if it’d be better to normalize paths more consistently, or to accept either slash like this patch does, but it does fix both symptoms. I’m pretty sure the Windows file APIs will accept either slash.
Thanks! This is because paths come from different places:
Internally, we have UTF-8 strings for paths. Any other encoding is transcoded to UTF-8.
Some stuff comes from std::path::Path, in particular pushing and popping components.
There is a normalisation step when adding or recording files, but I don’t know how “normal” the normalised paths are, in particular I don’t know how the different moving parts align with each other on this issue.
pmeunier closed this discussion on September 22, 2021
On Windows, pijul doesn’t consistently use
\
as a directory separator. I’m not sure if there are other places like this, butpath::components
only accepts\
and is sometimes given/
.Symptoms:
pijul diff --short
shows every file as untracked.pijul reset
sometimes errors and sometimes corrupts the working directory.I don’t know if it’d be better to normalize paths more consistently, or to accept either slash like this patch does, but it does fix both symptoms. I’m pretty sure the Windows file APIs will accept either slash.