{"action":"created","comment":{"url":"https://api.github.com/repos/constabulary/gb/pulls/comments/31875111","id":31875111,"diff_hunk":"@@ -137,13 +134,22 @@ func (g *gitrepo) URL() string {\n \treturn g.url\n }\n \n-func (g *gitrepo) Clone() (WorkingCopy, error) {\n+func (g *gitrepo) Checkout(branch, revision string) (WorkingCopy, error) {\n \tdir, err := mktmp()\n \tif err != nil {\n \t\treturn nil, err\n \t}\n \n-\tif err := runOut(os.Stderr, \"git\", \"clone\", g.url, dir); err != nil {\n+\targs := []string{\n+\t\t\"clone\",\n+\t\tg.url,\n+\t\tdir,\n+\t}\n+\tif branch != \"\" {\n+\t\targs = append(args, \"--branch\", branch)","path":"cmd/gb-vendor/vendor/repo.go","position":null,"original_position":45,"commit_id":"38b3176e2e10c9fe0b54af04b1db5fb8143857d2","original_commit_id":"70d11b6ed4fa31c1ded022935595747c2c53188e","user":{"login":"davidkaya","id":3832960,"avatar_url":"https://avatars.githubusercontent.com/u/3832960?v=3","gravatar_id":"","url":"https://api.github.com/users/davidkaya","html_url":"https://github.com/davidkaya","followers_url":"https://api.github.com/users/davidkaya/followers","following_url":"https://api.github.com/users/davidkaya/following{/other_user}","gists_url":"https://api.github.com/users/davidkaya/gists{/gist_id}","starred_url":"https://api.github.com/users/davidkaya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidkaya/subscriptions","organizations_url":"https://api.github.com/users/davidkaya/orgs","repos_url":"https://api.github.com/users/davidkaya/repos","events_url":"https://api.github.com/users/davidkaya/events{/privacy}","received_events_url":"https://api.github.com/users/davidkaya/received_events","type":"User","site_admin":false},"body":"Well honestly I would remove the support for revisions completely. Anyone who checks out revisions in projects, either does not know how to use vcs or wants to do something completely silly which can be done better (of course there could be some cases where this could be needed, but I have never seen such).\r\n\r\nThat would also remove the problem with `Detached HEAD`. \r\n\r\nNevertheless, you can checkout either branch or commit. You can't do both at once. User can't specify branch and revision at once, there must be a check if user didn't do that. \r\n\r\nIf you want to checkout commit (revision) you can do something like this:\r\n```bash\r\ngit clone $repo\r\ngit reset --hard $revision\r\n```","created_at":"2015-06-07T09:10:05Z","updated_at":"2015-06-07T09:10:05Z","html_url":"https://github.com/constabulary/gb/pull/191#discussion_r31875111","pull_request_url":"https://api.github.com/repos/constabulary/gb/pulls/191","_links":{"self":{"href":"https://api.github.com/repos/constabulary/gb/pulls/comments/31875111"},"html":{"href":"https://github.com/constabulary/gb/pull/191#discussion_r31875111"},"pull_request":{"href":"https://api.github.com/repos/constabulary/gb/pulls/191"}}},"pull_request":{"url":"https://api.github.com/repos/constabulary/gb/pulls/191","id":37102348,"html_url":"https://github.com/constabulary/gb/pull/191","diff_url":"https://github.com/constabulary/gb/pull/191.diff","patch_url":"https://github.com/constabulary/gb/pull/191.patch","issue_url":"https://api.github.com/repos/constabulary/gb/issues/191","number":191,"state":"open","locked":false,"title":"cmd/gb-vendor: merge wc.CheckoutBranch/CheckoutRevision into RemoteRepo.Checkout","user":{"login":"davecheney","id":7171,"avatar_url":"https://avatars.githubusercontent.com/u/7171?v=3","gravatar_id":"","url":"https://api.github.com/users/davecheney","html_url":"https://github.com/davecheney","followers_url":"https://api.github.com/users/davecheney/followers","following_url":"https://api.github.com/users/davecheney/following{/other_user}","gists_url":"https://api.github.com/users/davecheney/gists{/gist_id}","starred_url":"https://api.github.com/users/davecheney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davecheney/subscriptions","organizations_url":"https://api.github.com/users/davecheney/orgs","repos_url":"https://api.github.com/users/davecheney/repos","events_url":"https://api.github.com/users/davecheney/events{/privacy}","received_events_url":"https://api.github.com/users/davecheney/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-06-07T06:38:30Z","updated_at":"2015-06-07T09:10:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0eb7fff826e8899d155d82c6f9f3bb084c023b2c","assignee":{"login":"davidkaya","id":3832960,"avatar_url":"https://avatars.githubusercontent.com/u/3832960?v=3","gravatar_id":"","url":"https://api.github.com/users/davidkaya","html_url":"https://github.com/davidkaya","followers_url":"https://api.github.com/users/davidkaya/followers","following_url":"https://api.github.com/users/davidkaya/following{/other_user}","gists_url":"https://api.github.com/users/davidkaya/gists{/gist_id}","starred_url":"https://api.github.com/users/davidkaya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidkaya/subscriptions","organizations_url":"https://api.github.com/users/davidkaya/orgs","repos_url":"https://api.github.com/users/davidkaya/repos","events_url":"https://api.github.com/users/davidkaya/events{/privacy}","received_events_url":"https://api.github.com/users/davidkaya/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/constabulary/gb/pulls/191/commits","review_comments_url":"https://api.github.com/repos/constabulary/gb/pulls/191/comments","review_comment_url":"https://api.github.com/repos/constabulary/gb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/constabulary/gb/issues/191/comments","statuses_url":"https://api.github.com/repos/constabulary/gb/statuses/38b3176e2e10c9fe0b54af04b1db5fb8143857d2","head":{"label":"constabulary:refactor-remote-repo-checkout","ref":"refactor-remote-repo-checkout","sha":"38b3176e2e10c9fe0b54af04b1db5fb8143857d2","user":{"login":"constabulary","id":9853086,"avatar_url":"https://avatars.githubusercontent.com/u/9853086?v=3","gravatar_id":"","url":"https://api.github.com/users/constabulary","html_url":"https://github.com/constabulary","followers_url":"https://api.github.com/users/constabulary/followers","following_url":"https://api.github.com/users/constabulary/following{/other_user}","gists_url":"https://api.github.com/users/constabulary/gists{/gist_id}","starred_url":"https://api.github.com/users/constabulary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/constabulary/subscriptions","organizations_url":"https://api.github.com/users/constabulary/orgs","repos_url":"https://api.github.com/users/constabulary/repos","events_url":"https://api.github.com/users/constabulary/events{/privacy}","received_events_url":"https://api.github.com/users/constabulary/received_events","type":"Organization","site_admin":false},"repo":{"id":31404980,"name":"gb","full_name":"constabulary/gb","owner":{"login":"constabulary","id":9853086,"avatar_url":"https://avatars.githubusercontent.com/u/9853086?v=3","gravatar_id":"","url":"https://api.github.com/users/constabulary","html_url":"https://github.com/constabulary","followers_url":"https://api.github.com/users/constabulary/followers","following_url":"https://api.github.com/users/constabulary/following{/other_user}","gists_url":"https://api.github.com/users/constabulary/gists{/gist_id}","starred_url":"https://api.github.com/users/constabulary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/constabulary/subscriptions","organizations_url":"https://api.github.com/users/constabulary/orgs","repos_url":"https://api.github.com/users/constabulary/repos","events_url":"https://api.github.com/users/constabulary/events{/privacy}","received_events_url":"https://api.github.com/users/constabulary/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/constabulary/gb","description":"gb, the project based build tool for Go","fork":false,"url":"https://api.github.com/repos/constabulary/gb","forks_url":"https://api.github.com/repos/constabulary/gb/forks","keys_url":"https://api.github.com/repos/constabulary/gb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/constabulary/gb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/constabulary/gb/teams","hooks_url":"https://api.github.com/repos/constabulary/gb/hooks","issue_events_url":"https://api.github.com/repos/constabulary/gb/issues/events{/number}","events_url":"https://api.github.com/repos/constabulary/gb/events","assignees_url":"https://api.github.com/repos/constabulary/gb/assignees{/user}","branches_url":"https://api.github.com/repos/constabulary/gb/branches{/branch}","tags_url":"https://api.github.com/repos/constabulary/gb/tags","blobs_url":"https://api.github.com/repos/constabulary/gb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/constabulary/gb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/constabulary/gb/git/refs{/sha}","trees_url":"https://api.github.com/repos/constabulary/gb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/constabulary/gb/statuses/{sha}","languages_url":"https://api.github.com/repos/constabulary/gb/languages","stargazers_url":"https://api.github.com/repos/constabulary/gb/stargazers","contributors_url":"https://api.github.com/repos/constabulary/gb/contributors","subscribers_url":"https://api.github.com/repos/constabulary/gb/subscribers","subscription_url":"https://api.github.com/repos/constabulary/gb/subscription","commits_url":"https://api.github.com/repos/constabulary/gb/commits{/sha}","git_commits_url":"https://api.github.com/repos/constabulary/gb/git/commits{/sha}","comments_url":"https://api.github.com/repos/constabulary/gb/comments{/number}","issue_comment_url":"https://api.github.com/repos/constabulary/gb/issues/comments{/number}","contents_url":"https://api.github.com/repos/constabulary/gb/contents/{+path}","compare_url":"https://api.github.com/repos/constabulary/gb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/constabulary/gb/merges","archive_url":"https://api.github.com/repos/constabulary/gb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/constabulary/gb/downloads","issues_url":"https://api.github.com/repos/constabulary/gb/issues{/number}","pulls_url":"https://api.github.com/repos/constabulary/gb/pulls{/number}","milestones_url":"https://api.github.com/repos/constabulary/gb/milestones{/number}","notifications_url":"https://api.github.com/repos/constabulary/gb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/constabulary/gb/labels{/name}","releases_url":"https://api.github.com/repos/constabulary/gb/releases{/id}","created_at":"2015-02-27T05:30:43Z","updated_at":"2015-06-05T15:15:18Z","pushed_at":"2015-06-07T09:09:30Z","git_url":"git://github.com/constabulary/gb.git","ssh_url":"git@github.com:constabulary/gb.git","clone_url":"https://github.com/constabulary/gb.git","svn_url":"https://github.com/constabulary/gb","homepage":null,"size":1974,"stargazers_count":850,"watchers_count":850,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":29,"mirror_url":null,"open_issues_count":33,"forks":29,"open_issues":33,"watchers":850,"default_branch":"master"}},"base":{"label":"constabulary:master","ref":"master","sha":"ef2f9f2b5a027d6d59bbf84cde81c859b4890894","user":{"login":"constabulary","id":9853086,"avatar_url":"https://avatars.githubusercontent.com/u/9853086?v=3","gravatar_id":"","url":"https://api.github.com/users/constabulary","html_url":"https://github.com/constabulary","followers_url":"https://api.github.com/users/constabulary/followers","following_url":"https://api.github.com/users/constabulary/following{/other_user}","gists_url":"https://api.github.com/users/constabulary/gists{/gist_id}","starred_url":"https://api.github.com/users/constabulary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/constabulary/subscriptions","organizations_url":"https://api.github.com/users/constabulary/orgs","repos_url":"https://api.github.com/users/constabulary/repos","events_url":"https://api.github.com/users/constabulary/events{/privacy}","received_events_url":"https://api.github.com/users/constabulary/received_events","type":"Organization","site_admin":false},"repo":{"id":31404980,"name":"gb","full_name":"constabulary/gb","owner":{"login":"constabulary","id":9853086,"avatar_url":"https://avatars.githubusercontent.com/u/9853086?v=3","gravatar_id":"","url":"https://api.github.com/users/constabulary","html_url":"https://github.com/constabulary","followers_url":"https://api.github.com/users/constabulary/followers","following_url":"https://api.github.com/users/constabulary/following{/other_user}","gists_url":"https://api.github.com/users/constabulary/gists{/gist_id}","starred_url":"https://api.github.com/users/constabulary/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/constabulary/subscriptions","organizations_url":"https://api.github.com/users/constabulary/orgs","repos_url":"https://api.github.com/users/constabulary/repos","events_url":"https://api.github.com/users/constabulary/events{/privacy}","received_events_url":"https://api.github.com/users/constabulary/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/constabulary/gb","description":"gb, the project based build tool for Go","fork":false,"url":"https://api.github.com/repos/constabulary/gb","forks_url":"https://api.github.com/repos/constabulary/gb/forks","keys_url":"https://api.github.com/repos/constabulary/gb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/constabulary/gb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/constabulary/gb/teams","hooks_url":"https://api.github.com/repos/constabulary/gb/hooks","issue_events_url":"https://api.github.com/repos/constabulary/gb/issues/events{/number}","events_url":"https://api.github.com/repos/constabulary/gb/events","assignees_url":"https://api.github.com/repos/constabulary/gb/assignees{/user}","branches_url":"https://api.github.com/repos/constabulary/gb/branches{/branch}","tags_url":"https://api.github.com/repos/constabulary/gb/tags","blobs_url":"https://api.github.com/repos/constabulary/gb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/constabulary/gb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/constabulary/gb/git/refs{/sha}","trees_url":"https://api.github.com/repos/constabulary/gb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/constabulary/gb/statuses/{sha}","languages_url":"https://api.github.com/repos/constabulary/gb/languages","stargazers_url":"https://api.github.com/repos/constabulary/gb/stargazers","contributors_url":"https://api.github.com/repos/constabulary/gb/contributors","subscribers_url":"https://api.github.com/repos/constabulary/gb/subscribers","subscription_url":"https://api.github.com/repos/constabulary/gb/subscription","commits_url":"https://api.github.com/repos/constabulary/gb/commits{/sha}","git_commits_url":"https://api.github.com/repos/constabulary/gb/git/commits{/sha}","comments_url":"https://api.github.com/repos/constabulary/gb/comments{/number}","issue_comment_url":"https://api.github.com/repos/constabulary/gb/issues/comments{/number}","contents_url":"https://api.github.com/repos/constabulary/gb/contents/{+path}","compare_url":"https://api.github.com/repos/constabulary/gb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/constabulary/gb/merges","archive_url":"https://api.github.com/repos/constabulary/gb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/constabulary/gb/downloads","issues_url":"https://api.github.com/repos/constabulary/gb/issues{/number}","pulls_url":"https://api.github.com/repos/constabulary/gb/pulls{/number}","milestones_url":"https://api.github.com/repos/constabulary/gb/milestones{/number}","notifications_url":"https://api.github.com/repos/constabulary/gb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/constabulary/gb/labels{/name}","releases_url":"https://api.github.com/repos/constabulary/gb/releases{/id}","created_at":"2015-02-27T05:30:43Z","updated_at":"2015-06-05T15:15:18Z","pushed_at":"2015-06-07T09:09:30Z","git_url":"git://github.com/constabulary/gb.git","ssh_url":"git@github.com:constabulary/gb.git","clone_url":"https://github.com/constabulary/gb.git","svn_url":"https://github.com/constabulary/gb","homepage":null,"size":1974,"stargazers_count":850,"watchers_count":850,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":29,"mirror_url":null,"open_issues_count":33,"forks":29,"open_issues":33,"watchers":850,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/constabulary/gb/pulls/191"},"html":{"href":"https://github.com/constabulary/gb/pull/191"},"issue":{"href":"https://api.github.com/repos/constabulary/gb/issues/191"},"comments":{"href":"https://api.github.com/repos/constabulary/gb/issues/191/comments"},"review_comments":{"href":"https://api.github.com/repos/constabulary/gb/pulls/191/comments"},"review_comment":{"href":"https://api.github.com/repos/constabulary/gb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/constabulary/gb/pulls/191/commits"},"statuses":{"href":"https://api.github.com/repos/constabulary/gb/statuses/38b3176e2e10c9fe0b54af04b1db5fb8143857d2"}}}}