ropensci / gittargets

Data version control for reproducible analysis pipelines in R with {targets}.
https://docs.ropensci.org/gittargets/
Other
87 stars 1 forks source link

`system2()` call "git" leads to issue on Windows #12

Closed psychelzh closed 2 years ago

psychelzh commented 2 years ago

Prework

Description

This is just the same as https://github.com/yihui/crandalf/issues/24. On Windows OS, tar_git_ok() complains even if the user name and email are configured globally. This is simply because R for Windows sets HOME environment as Documents folder. Hopefully this is taken care of here.

Reproducible example

gittargets::tar_git_ok()
#> ✔ Git binary: 'C:\PROGRA~1\Git\cmd\git.exe'
#> ✖ No Git config global user email. See details in ?tar_git_ok().
#> ✖ No Git config global user email. See details in ?tar_git_ok().
#> [1] FALSE

Created on 2022-08-20 with reprex v2.0.2

psychelzh commented 2 years ago

Maybe an alternative is to use "gert" package?

wlandau commented 2 years ago

Thanks for letting me know. Not sure why I forgot to use processx::run() on gittargets:::tar_git_binary() instead of system2("git", ...), but the latest commits should fix it.

Unfortunately I can't use gert because libgit2 is incompatible with Git LFS.

wlandau commented 2 years ago

Seems I misread the docs of processx::run(). Look like we'll need to temporarily set HOME after all.

wlandau commented 2 years ago

Looks to be fixed this time: https://github.com/ropensci/gittargets/runs/7939003978