use user_path_prep() in git_vaccinated()#1560
Conversation
|
I've looked over this and there's something that doesn't quite sit right about it. The path aspects of usethis are a real hotspot for introducing undesired change. So I'll have to let this sit until I think about it harder (I'm not working on usethis atm.) |
|
Recording research I did previously on global gitignore on Windows (i.e. I can see that I've visited these links before): https://stackoverflow.com/questions/7335420/global-git-ignore Summary: I think, with modern Git Windows tooling, this is often how If so, that |
|
OK I uploaded this into my head again. Yes I think we should process this path with I still think usethis should write this path as an absolute path on Windows. Based on my reading, that still seems to be safest at this point. At least, it's unambiguous. |
git_sitrep()errors when trying to check.gitignore.Apparently this is caused by the call to
git_vaccinated()The root of the problem seems to be a difference in the path expansion of
~in git and R.The
core.excludesFileis configured like so (run in Git-Bash)This is also picked up by usethis
but this is then passed to
read_utf8() |> base::readLines(), and that expandspathtoI think we have to
user_path_prep()thepathfirst. (Note that I, as a user, supplied thecore.excludesFilepath, souser_path_prep()ing it is only consistent withusethis/principles.md
Line 80 in 865e929
That way we can also eliminate the full-path
hackworkaround inensure_core_excludesFile()(which prevents.gitconfigfrom being portable).usethis/R/utils-git.R
Lines 84 to 87 in 865e929
Session info