use_git_config() behavior inconsistent with article
ijlyttle opened this issue · 4 comments
Edit: I did not look at this carefully enough; as @cderv points out, this is very likely a documentation issue.
As best as I can tell, this was working in usethis 1.4.0:
usethis/vignettes/articles/usethis-setup.Rmd
Lines 72 to 73 in f08ecb6
I updated one of my machines to the dev version, and it returns without printing anything to the screen.
The operative code in usethis seems to be in an internal function git_config()
, which then calls git2r::config()
:
Lines 297 to 310 in 37a774e
When I updated my usethis, it updated git2r 0.24.0 -> 0.25.2
Happy to dig further, but wanted to surface this now in case you had some ideas already.
Thanks!
Upon further consideration, I suspect a "culprit" is the invisible(old)
line that returns from usethis:::git_config()
, not git2r.
@ijlyttle I think this is an intended change as it is documented in the NEWS file for the current dev version.
use_git_config() now invisibly returns the previous values of the settings.
and it is in place since since bbc6b47
also documented
Line 105 in f08ecb6
Before that, yes this function was returning visibly all the time for user name and email only
Lines 132 to 133 in a4c0113
now it returns invisibly only the modified values.
I guess only usethis-setup.Rmd
should be updated ?
Unless old behaviour should be restored by printing configuration if interactive()
and no value to modify is provided : usethis::use_git_config()
? or like a possible git_config_sitrep()
?
However, git2r::config()
does exactly this and return a pretty descent list with all the configuration if nothing is modified.
Yes I'd appreciate a change to the setup vignette. Note that I just pushed a bit of a update to that document myself. But I didn't touch this stuff.