{"action":"created","comment":{"url":"https://api.github.com/repos/sdboyer/gps/pulls/comments/105320312","pull_request_review_id":26194817,"id":105320312,"diff_hunk":"@@ -0,0 +1,300 @@\n+package gps\n+\n+import (\n+\t\"bytes\"\n+\t\"encoding/xml\"\n+\t\"io/ioutil\"\n+\t\"os\"\n+\t\"path/filepath\"\n+\t\"runtime\"\n+\t\"strings\"\n+\t\"time\"\n+\n+\t\"github.com/Masterminds/vcs\"\n+)\n+\n+type gitRepo struct {\n+\t*vcs.GitRepo\n+}\n+\n+func (r *gitRepo) Get() error {\n+\tout, err := runFromCwd(\"git\", \"clone\", \"--recursive\", r.Remote(), r.LocalPath())\n+\n+\t// There are some windows cases where Git cannot create the parent directory,\n+\t// if it does not already exist, to the location it's trying to create the\n+\t// repo. Catch that error and try to handle it.\n+\tif err != nil && r.isUnableToCreateDir(err) {\n+\t\tbasePath := filepath.Dir(filepath.FromSlash(r.LocalPath()))\n+\t\tif _, err := os.Stat(basePath); os.IsNotExist(err) {\n+\t\t\terr = os.MkdirAll(basePath, 0755)\n+\t\t\tif err != nil {\n+\t\t\t\treturn vcs.NewLocalError(\"Unable to create directory\", err, \"\")\n+\t\t\t}\n+\n+\t\t\tout, err = runFromCwd(\"git\", \"clone\", r.Remote(), r.LocalPath())\n+\t\t\tif err != nil {\n+\t\t\t\treturn vcs.NewRemoteError(\"Unable to get repository\", err, string(out))","path":"vcs_repo.go","position":36,"original_position":36,"commit_id":"0ce14e648448b83f7a414a8d6562230287f8fbea","original_commit_id":"0ce14e648448b83f7a414a8d6562230287f8fbea","user":{"login":"sdboyer","id":21599,"avatar_url":"https://avatars3.githubusercontent.com/u/21599?v=3","gravatar_id":"","url":"https://api.github.com/users/sdboyer","html_url":"https://github.com/sdboyer","followers_url":"https://api.github.com/users/sdboyer/followers","following_url":"https://api.github.com/users/sdboyer/following{/other_user}","gists_url":"https://api.github.com/users/sdboyer/gists{/gist_id}","starred_url":"https://api.github.com/users/sdboyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdboyer/subscriptions","organizations_url":"https://api.github.com/users/sdboyer/orgs","repos_url":"https://api.github.com/users/sdboyer/repos","events_url":"https://api.github.com/users/sdboyer/events{/privacy}","received_events_url":"https://api.github.com/users/sdboyer/received_events","type":"User","site_admin":false},"body":"I realize this is mostly just copying over from Masterminds/vcs, but let's improve all these errors in two ways:\r\n\r\n1. Per standards, don't capitalize the first letter\r\n2. In methods where the same text is used over and over, differentiate the messages. (The repetition might be fine in this method, but there's other places where it potentially obscures what's really going on)","created_at":"2017-03-10T02:35:33Z","updated_at":"2017-03-10T02:39:30Z","html_url":"https://github.com/sdboyer/gps/pull/171#discussion_r105320312","pull_request_url":"https://api.github.com/repos/sdboyer/gps/pulls/171","_links":{"self":{"href":"https://api.github.com/repos/sdboyer/gps/pulls/comments/105320312"},"html":{"href":"https://github.com/sdboyer/gps/pull/171#discussion_r105320312"},"pull_request":{"href":"https://api.github.com/repos/sdboyer/gps/pulls/171"}}},"pull_request":{"url":"https://api.github.com/repos/sdboyer/gps/pulls/171","id":105636131,"html_url":"https://github.com/sdboyer/gps/pull/171","diff_url":"https://github.com/sdboyer/gps/pull/171.diff","patch_url":"https://github.com/sdboyer/gps/pull/171.patch","issue_url":"https://api.github.com/repos/sdboyer/gps/issues/171","number":171,"state":"open","locked":false,"title":"Monitored commands (WIP)","user":{"login":"erizocosmico","id":1312023,"avatar_url":"https://avatars2.githubusercontent.com/u/1312023?v=3","gravatar_id":"","url":"https://api.github.com/users/erizocosmico","html_url":"https://github.com/erizocosmico","followers_url":"https://api.github.com/users/erizocosmico/followers","following_url":"https://api.github.com/users/erizocosmico/following{/other_user}","gists_url":"https://api.github.com/users/erizocosmico/gists{/gist_id}","starred_url":"https://api.github.com/users/erizocosmico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erizocosmico/subscriptions","organizations_url":"https://api.github.com/users/erizocosmico/orgs","repos_url":"https://api.github.com/users/erizocosmico/repos","events_url":"https://api.github.com/users/erizocosmico/events{/privacy}","received_events_url":"https://api.github.com/users/erizocosmico/received_events","type":"User","site_admin":false},"body":"As discussed in #84, I'll be working on this WIP so you can see if the direction this is going is where you want it to @sdboyer \r\n\r\nThe cleaner way to do this, imho, was to wrap each different `vcs.Repo` implementation that is a `vcs.Repo` itself too, so we don't have to reimplement anything. In practice, it has ended up in a lot of copied code from vcs because of not exported code and so on.\r\n\r\nI've only implemented the wrapper for git repos so far, so tell me if you want me to keep on this path or do something else entirely. \r\n","created_at":"2017-02-10T14:19:54Z","updated_at":"2017-03-10T02:39:30Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c810296fa61db4fcc49f7e5249737296ac347b66","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/sdboyer/gps/pulls/171/commits","review_comments_url":"https://api.github.com/repos/sdboyer/gps/pulls/171/comments","review_comment_url":"https://api.github.com/repos/sdboyer/gps/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sdboyer/gps/issues/171/comments","statuses_url":"https://api.github.com/repos/sdboyer/gps/statuses/0ce14e648448b83f7a414a8d6562230287f8fbea","head":{"label":"erizocosmico:monitored-commands","ref":"monitored-commands","sha":"0ce14e648448b83f7a414a8d6562230287f8fbea","user":{"login":"erizocosmico","id":1312023,"avatar_url":"https://avatars2.githubusercontent.com/u/1312023?v=3","gravatar_id":"","url":"https://api.github.com/users/erizocosmico","html_url":"https://github.com/erizocosmico","followers_url":"https://api.github.com/users/erizocosmico/followers","following_url":"https://api.github.com/users/erizocosmico/following{/other_user}","gists_url":"https://api.github.com/users/erizocosmico/gists{/gist_id}","starred_url":"https://api.github.com/users/erizocosmico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erizocosmico/subscriptions","organizations_url":"https://api.github.com/users/erizocosmico/orgs","repos_url":"https://api.github.com/users/erizocosmico/repos","events_url":"https://api.github.com/users/erizocosmico/events{/privacy}","received_events_url":"https://api.github.com/users/erizocosmico/received_events","type":"User","site_admin":false},"repo":{"id":80354937,"name":"gps","full_name":"erizocosmico/gps","owner":{"login":"erizocosmico","id":1312023,"avatar_url":"https://avatars2.githubusercontent.com/u/1312023?v=3","gravatar_id":"","url":"https://api.github.com/users/erizocosmico","html_url":"https://github.com/erizocosmico","followers_url":"https://api.github.com/users/erizocosmico/followers","following_url":"https://api.github.com/users/erizocosmico/following{/other_user}","gists_url":"https://api.github.com/users/erizocosmico/gists{/gist_id}","starred_url":"https://api.github.com/users/erizocosmico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erizocosmico/subscriptions","organizations_url":"https://api.github.com/users/erizocosmico/orgs","repos_url":"https://api.github.com/users/erizocosmico/repos","events_url":"https://api.github.com/users/erizocosmico/events{/privacy}","received_events_url":"https://api.github.com/users/erizocosmico/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/erizocosmico/gps","description":"your dependencies have arrived","fork":true,"url":"https://api.github.com/repos/erizocosmico/gps","forks_url":"https://api.github.com/repos/erizocosmico/gps/forks","keys_url":"https://api.github.com/repos/erizocosmico/gps/keys{/key_id}","collaborators_url":"https://api.github.com/repos/erizocosmico/gps/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/erizocosmico/gps/teams","hooks_url":"https://api.github.com/repos/erizocosmico/gps/hooks","issue_events_url":"https://api.github.com/repos/erizocosmico/gps/issues/events{/number}","events_url":"https://api.github.com/repos/erizocosmico/gps/events","assignees_url":"https://api.github.com/repos/erizocosmico/gps/assignees{/user}","branches_url":"https://api.github.com/repos/erizocosmico/gps/branches{/branch}","tags_url":"https://api.github.com/repos/erizocosmico/gps/tags","blobs_url":"https://api.github.com/repos/erizocosmico/gps/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/erizocosmico/gps/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/erizocosmico/gps/git/refs{/sha}","trees_url":"https://api.github.com/repos/erizocosmico/gps/git/trees{/sha}","statuses_url":"https://api.github.com/repos/erizocosmico/gps/statuses/{sha}","languages_url":"https://api.github.com/repos/erizocosmico/gps/languages","stargazers_url":"https://api.github.com/repos/erizocosmico/gps/stargazers","contributors_url":"https://api.github.com/repos/erizocosmico/gps/contributors","subscribers_url":"https://api.github.com/repos/erizocosmico/gps/subscribers","subscription_url":"https://api.github.com/repos/erizocosmico/gps/subscription","commits_url":"https://api.github.com/repos/erizocosmico/gps/commits{/sha}","git_commits_url":"https://api.github.com/repos/erizocosmico/gps/git/commits{/sha}","comments_url":"https://api.github.com/repos/erizocosmico/gps/comments{/number}","issue_comment_url":"https://api.github.com/repos/erizocosmico/gps/issues/comments{/number}","contents_url":"https://api.github.com/repos/erizocosmico/gps/contents/{+path}","compare_url":"https://api.github.com/repos/erizocosmico/gps/compare/{base}...{head}","merges_url":"https://api.github.com/repos/erizocosmico/gps/merges","archive_url":"https://api.github.com/repos/erizocosmico/gps/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/erizocosmico/gps/downloads","issues_url":"https://api.github.com/repos/erizocosmico/gps/issues{/number}","pulls_url":"https://api.github.com/repos/erizocosmico/gps/pulls{/number}","milestones_url":"https://api.github.com/repos/erizocosmico/gps/milestones{/number}","notifications_url":"https://api.github.com/repos/erizocosmico/gps/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/erizocosmico/gps/labels{/name}","releases_url":"https://api.github.com/repos/erizocosmico/gps/releases{/id}","deployments_url":"https://api.github.com/repos/erizocosmico/gps/deployments","created_at":"2017-01-29T15:51:56Z","updated_at":"2017-01-29T15:51:58Z","pushed_at":"2017-03-09T20:21:58Z","git_url":"git://github.com/erizocosmico/gps.git","ssh_url":"git@github.com:erizocosmico/gps.git","clone_url":"https://github.com/erizocosmico/gps.git","svn_url":"https://github.com/erizocosmico/gps","homepage":"","size":1113,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sdboyer:master","ref":"master","sha":"41bc589e291a591413a60f930e30815afd7c4fbd","user":{"login":"sdboyer","id":21599,"avatar_url":"https://avatars3.githubusercontent.com/u/21599?v=3","gravatar_id":"","url":"https://api.github.com/users/sdboyer","html_url":"https://github.com/sdboyer","followers_url":"https://api.github.com/users/sdboyer/followers","following_url":"https://api.github.com/users/sdboyer/following{/other_user}","gists_url":"https://api.github.com/users/sdboyer/gists{/gist_id}","starred_url":"https://api.github.com/users/sdboyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdboyer/subscriptions","organizations_url":"https://api.github.com/users/sdboyer/orgs","repos_url":"https://api.github.com/users/sdboyer/repos","events_url":"https://api.github.com/users/sdboyer/events{/privacy}","received_events_url":"https://api.github.com/users/sdboyer/received_events","type":"User","site_admin":false},"repo":{"id":53911920,"name":"gps","full_name":"sdboyer/gps","owner":{"login":"sdboyer","id":21599,"avatar_url":"https://avatars3.githubusercontent.com/u/21599?v=3","gravatar_id":"","url":"https://api.github.com/users/sdboyer","html_url":"https://github.com/sdboyer","followers_url":"https://api.github.com/users/sdboyer/followers","following_url":"https://api.github.com/users/sdboyer/following{/other_user}","gists_url":"https://api.github.com/users/sdboyer/gists{/gist_id}","starred_url":"https://api.github.com/users/sdboyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sdboyer/subscriptions","organizations_url":"https://api.github.com/users/sdboyer/orgs","repos_url":"https://api.github.com/users/sdboyer/repos","events_url":"https://api.github.com/users/sdboyer/events{/privacy}","received_events_url":"https://api.github.com/users/sdboyer/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sdboyer/gps","description":"your dependencies have arrived","fork":false,"url":"https://api.github.com/repos/sdboyer/gps","forks_url":"https://api.github.com/repos/sdboyer/gps/forks","keys_url":"https://api.github.com/repos/sdboyer/gps/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sdboyer/gps/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sdboyer/gps/teams","hooks_url":"https://api.github.com/repos/sdboyer/gps/hooks","issue_events_url":"https://api.github.com/repos/sdboyer/gps/issues/events{/number}","events_url":"https://api.github.com/repos/sdboyer/gps/events","assignees_url":"https://api.github.com/repos/sdboyer/gps/assignees{/user}","branches_url":"https://api.github.com/repos/sdboyer/gps/branches{/branch}","tags_url":"https://api.github.com/repos/sdboyer/gps/tags","blobs_url":"https://api.github.com/repos/sdboyer/gps/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sdboyer/gps/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sdboyer/gps/git/refs{/sha}","trees_url":"https://api.github.com/repos/sdboyer/gps/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sdboyer/gps/statuses/{sha}","languages_url":"https://api.github.com/repos/sdboyer/gps/languages","stargazers_url":"https://api.github.com/repos/sdboyer/gps/stargazers","contributors_url":"https://api.github.com/repos/sdboyer/gps/contributors","subscribers_url":"https://api.github.com/repos/sdboyer/gps/subscribers","subscription_url":"https://api.github.com/repos/sdboyer/gps/subscription","commits_url":"https://api.github.com/repos/sdboyer/gps/commits{/sha}","git_commits_url":"https://api.github.com/repos/sdboyer/gps/git/commits{/sha}","comments_url":"https://api.github.com/repos/sdboyer/gps/comments{/number}","issue_comment_url":"https://api.github.com/repos/sdboyer/gps/issues/comments{/number}","contents_url":"https://api.github.com/repos/sdboyer/gps/contents/{+path}","compare_url":"https://api.github.com/repos/sdboyer/gps/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sdboyer/gps/merges","archive_url":"https://api.github.com/repos/sdboyer/gps/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sdboyer/gps/downloads","issues_url":"https://api.github.com/repos/sdboyer/gps/issues{/number}","pulls_url":"https://api.github.com/repos/sdboyer/gps/pulls{/number}","milestones_url":"https://api.github.com/repos/sdboyer/gps/milestones{/number}","notifications_url":"https://api.github.com/repos/sdboyer/gps/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sdboyer/gps/labels{/name}","releases_url":"https://api.github.com/repos/sdboyer/gps/releases{/id}","deployments_url":"https://api.github.com/repos/sdboyer/gps/deployments","created_at":"2016-03-15T03:33:42Z","updated_at":"2017-03-09T00:36:17Z","pushed_at":"2017-03-10T02:19:13Z","git_url":"git://github.com/sdboyer/gps.git","ssh_url":"git@github.com:sdboyer/gps.git","clone_url":"https://github.com/sdboyer/gps.git","svn_url":"https://github.com/sdboyer/gps","homepage":"","size":1218,"stargazers_count":227,"watchers_count":227,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":14,"mirror_url":null,"open_issues_count":47,"forks":14,"open_issues":47,"watchers":227,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sdboyer/gps/pulls/171"},"html":{"href":"https://github.com/sdboyer/gps/pull/171"},"issue":{"href":"https://api.github.com/repos/sdboyer/gps/issues/171"},"comments":{"href":"https://api.github.com/repos/sdboyer/gps/issues/171/comments"},"review_comments":{"href":"https://api.github.com/repos/sdboyer/gps/pulls/171/comments"},"review_comment":{"href":"https://api.github.com/repos/sdboyer/gps/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sdboyer/gps/pulls/171/commits"},"statuses":{"href":"https://api.github.com/repos/sdboyer/gps/statuses/0ce14e648448b83f7a414a8d6562230287f8fbea"}}}}
{"actor":{"display_login":"sdboyer"}}