r-lib / gert

Simple git client for R
https://docs.ropensci.org/gert/
Other
146 stars 31 forks source link

fix: make git_cherry_pick() accept a shortened hash #223

Closed maelle closed 3 months ago

maelle commented 3 months ago

I tried using resolve_refish(ref, repo) in rebase.c but I got stuck because I wasn't able to create a thing of the right type for this line:

https://github.com/r-lib/gert/blob/d0fc50f033dda9e8f9634d20fe47462cb188f40b/src/rebase.c#L92

I'd be curious to see how to actually solve this on the C side.

jeroen commented 3 months ago

To fix the check you need to move git_config_set() down and give it the repo paramater. We are not allowed to modify global git configuration settings on CRAN so therefore they need to be set locally per repo.

Alternatively you can use git_commit(...., author = "jerry <jerry@gmail.com>")

jeroen commented 3 months ago

Thanks !

maelle commented 3 months ago

thank you!!