{"comment":{"url":"https://api.github.com/repos/jimmidyson/go-git/comments/23240238","html_url":"https://github.com/jimmidyson/go-git/commit/1c61b08dd3dbdb69179af6fb40a1b0281221aa97#commitcomment-23240238","id":23240238,"user":{"login":"JoshuaSjoding","id":220287,"avatar_url":"https://avatars0.githubusercontent.com/u/220287?v=4","gravatar_id":"","url":"https://api.github.com/users/JoshuaSjoding","html_url":"https://github.com/JoshuaSjoding","followers_url":"https://api.github.com/users/JoshuaSjoding/followers","following_url":"https://api.github.com/users/JoshuaSjoding/following{/other_user}","gists_url":"https://api.github.com/users/JoshuaSjoding/gists{/gist_id}","starred_url":"https://api.github.com/users/JoshuaSjoding/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JoshuaSjoding/subscriptions","organizations_url":"https://api.github.com/users/JoshuaSjoding/orgs","repos_url":"https://api.github.com/users/JoshuaSjoding/repos","events_url":"https://api.github.com/users/JoshuaSjoding/events{/privacy}","received_events_url":"https://api.github.com/users/JoshuaSjoding/received_events","type":"User","site_admin":false},"position":5,"line":54,"path":"options.go","commit_id":"1c61b08dd3dbdb69179af6fb40a1b0281221aa97","created_at":"2017-07-22T08:49:32Z","updated_at":"2017-07-22T08:49:32Z","body":"@mcuadros  I like using `context` for cancellation, but I personally don't like using `context.Value()`; the values are all weakly typed (`interface{}`), it's hard to document well and it makes for a weak API contract.\r\n\r\n@jimmidyson Creating a `git.Client` struct that wraps the set of plumbing transports is an interesting idea. I assume it would look something like this:\r\n\r\n```\r\npackage git\r\n\r\ntype Client struct {\r\n\tTransports map[string]transport.Transport\r\n}\r\n\r\nvar DefaultClient = &Client{\r\n\tTransports: map[string]transport.Transport{\r\n\t\t// Default transports go here\r\n\t},\r\n}\r\n\r\nfunc (c *Client) Clone(...) {...}\r\n\r\nfunc Clone(...) {\r\n\tDefaultClient.Clone(...)\r\n}\r\n```\r\n\r\nIntegrating with `Clone()` is easy, but somehow the new `Client` type would also have to integrate with `Repository` and/or `Remote`. After thinking about it for a while, it's not obvious to me what that integration would look like.\r\n\r\n`go-git` is repository-oriented. The transports are treated as a sort of low-level detail that's necessary to make the repositories talk. It's interesting that the [transport client package](http://godoc.org/gopkg.in/src-d/go-git.v4/plumbing/transport/client) is under the plumbing umbrella; it makes me think that creating a high-level `git.Client` is a bit of a design shift. Whether it's warranted or not is unclear to me."}}
{"actor":{"display_login":"JoshuaSjoding"}}