Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
7 tasks done
psychelzh opened this issue Aug 20, 2022 · 4 comments
Closed
7 tasks done

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

psychelzh opened this issue Aug 20, 2022 · 4 comments
Assignees

Comments

@psychelzh
Copy link

Prework

  • Read and agree to the Contributor Code of Conduct and contributing guidelines.
  • Confirm that your issue is a genuine bug in the gittargets package itself and not a user error, known limitation, or issue from another package that gittargets depends on. For example, if you get errors running tar_make_clustermq(), try isolating the problem in a reproducible example that runs clustermq and not gittargets. And for miscellaneous troubleshooting, please post to discussions instead of issues.
  • If there is already a relevant issue, whether open or closed, comment on the existing thread instead of posting a new issue.
  • Post a minimal reproducible example like this one so the maintainer can troubleshoot the problems you identify. A reproducible example is:
    • Runnable: post enough R code and data so any onlooker can create the error on their own computer.
    • Minimal: reduce runtime wherever possible and remove complicated details that are irrelevant to the issue at hand.
    • Readable: format your code according to the tidyverse style guide.

Description

This is just the same as yihui/crandalf#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
Copy link
Author

Maybe an alternative is to use "gert" package?

@wlandau
Copy link
Collaborator

wlandau commented Aug 21, 2022

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
Copy link
Collaborator

wlandau commented Aug 21, 2022

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

@wlandau wlandau reopened this Aug 21, 2022
@wlandau
Copy link
Collaborator

wlandau commented Aug 21, 2022

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

@wlandau wlandau closed this as completed Aug 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants