cli / go-gh

A Go module for interacting with gh and the GitHub API from the command line.
https://pkg.go.dev/github.com/cli/go-gh/v2
MIT License
322 stars 45 forks source link

Export git package and git client #75

Closed samcoe closed 1 year ago

samcoe commented 1 year ago

This PR exports the git package that had been internal for some time, no behavior changes here. It also adds in a new git client type that will be used for interacting with a local git repository. It is heavily inspired by this work done by @mislav. Right now the only exported methods on the git client are Command which is the base method, similar to Do for http.Client, that all other methods will use to execute commands and Remotes which lists remotes for the local repo. The reason I added Remotes is because it is needed within go-gh. I think for the initial version these are the only two that will be supported but more will be added in the future as necessary.

TODO:

samcoe commented 1 year ago

@mislav Thanks for the feedback! You have raised some good points. It is possible that this work should be started in cli/cli, I mostly started it here due to https://github.com/cli/cli/issues/5544 where we had targeted it for extraction. We can take it off that list though if you don't think it is valuable to have in go-gh though.

samcoe commented 1 year ago

Offline, we have decided now is not the right time to introduce this feature into go-gh but rather start with an implementation in cli/cli and see how that goes and when we feel more confident in this direction we will extract it.