{"action":"created","comment":{"url":"https://api.github.com/repos/commercialhaskell/stack/pulls/comments/197601014","pull_request_review_id":131383263,"id":197601014,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5NzYwMTAxNA==","diff_hunk":"@@ -106,3 +125,24 @@ templateName (TemplateName prefix _) = prefix\n -- | Get the path of the template.\n templatePath :: TemplateName -> TemplatePath\n templatePath (TemplateName _ fp) = fp\n+\n+defaultRepoUser :: Text\n+defaultRepoUser = \"commercialhaskell\"\n+\n+-- | Parses a template path of the form @github:user/template@.\n+parseRepoPath :: String -> Maybe RepoTemplatePath\n+parseRepoPath s =\n+  case T.splitOn \":\" (T.pack s) of\n+    [\"github\"    , rest] -> parseRepoPathWithService Github rest\n+    [\"gitlab\"    , rest] -> parseRepoPathWithService Gitlab rest\n+    [\"bitbucket\" , rest] -> parseRepoPathWithService Bitbucket rest\n+    _                    -> Nothing\n+\n+-- | Parses a template path of the form @user/template@, assuming the default service.\n+parseRepoPathWithService :: RepoService -> Text -> Maybe RepoTemplatePath\n+parseRepoPathWithService service path =\n+  case T.splitOn \"/\" path of\n+    [user, name] -> Just $ RepoTemplatePath service user name\n+    [name]       -> Just $ RepoTemplatePath service defaultRepoUser name","path":"src/Stack/Types/TemplateName.hs","position":72,"original_position":72,"commit_id":"2e143182d70a5ee2934db65094b9f704eb73fc10","original_commit_id":"2e143182d70a5ee2934db65094b9f704eb73fc10","user":{"login":"johnmendonca","id":61379,"node_id":"MDQ6VXNlcjYxMzc5","avatar_url":"https://avatars2.githubusercontent.com/u/61379?v=4","gravatar_id":"","url":"https://api.github.com/users/johnmendonca","html_url":"https://github.com/johnmendonca","followers_url":"https://api.github.com/users/johnmendonca/followers","following_url":"https://api.github.com/users/johnmendonca/following{/other_user}","gists_url":"https://api.github.com/users/johnmendonca/gists{/gist_id}","starred_url":"https://api.github.com/users/johnmendonca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnmendonca/subscriptions","organizations_url":"https://api.github.com/users/johnmendonca/orgs","repos_url":"https://api.github.com/users/johnmendonca/repos","events_url":"https://api.github.com/users/johnmendonca/events{/privacy}","received_events_url":"https://api.github.com/users/johnmendonca/received_events","type":"User","site_admin":false},"body":"Oh right, we end up here in the case where just a single name is given, thanks.","created_at":"2018-06-23T03:29:15Z","updated_at":"2018-06-23T03:29:15Z","html_url":"https://github.com/commercialhaskell/stack/pull/4103#discussion_r197601014","pull_request_url":"https://api.github.com/repos/commercialhaskell/stack/pulls/4103","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/commercialhaskell/stack/pulls/comments/197601014"},"html":{"href":"https://github.com/commercialhaskell/stack/pull/4103#discussion_r197601014"},"pull_request":{"href":"https://api.github.com/repos/commercialhaskell/stack/pulls/4103"}},"in_reply_to_id":197595945},"pull_request":{"url":"https://api.github.com/repos/commercialhaskell/stack/pulls/4103","id":196339306,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk2MzM5MzA2","html_url":"https://github.com/commercialhaskell/stack/pull/4103","diff_url":"https://github.com/commercialhaskell/stack/pull/4103.diff","patch_url":"https://github.com/commercialhaskell/stack/pull/4103.patch","issue_url":"https://api.github.com/repos/commercialhaskell/stack/issues/4103","number":4103,"state":"open","locked":false,"title":"4039 namespaced templates","user":{"login":"lylek","id":1392658,"node_id":"MDQ6VXNlcjEzOTI2NTg=","avatar_url":"https://avatars2.githubusercontent.com/u/1392658?v=4","gravatar_id":"","url":"https://api.github.com/users/lylek","html_url":"https://github.com/lylek","followers_url":"https://api.github.com/users/lylek/followers","following_url":"https://api.github.com/users/lylek/following{/other_user}","gists_url":"https://api.github.com/users/lylek/gists{/gist_id}","starred_url":"https://api.github.com/users/lylek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lylek/subscriptions","organizations_url":"https://api.github.com/users/lylek/orgs","repos_url":"https://api.github.com/users/lylek/repos","events_url":"https://api.github.com/users/lylek/events{/privacy}","received_events_url":"https://api.github.com/users/lylek/received_events","type":"User","site_admin":false},"body":"* `stack new` now allows template names of the form username/foo to download from a user other than commercialstack on Github, and can be prefixed with the service`github:`, `gitlab:`, or `bitbucket:`.\r\n* Changelog.md has been updated\r\n* Help text for stack new has been updated\r\n* Tested this by temporarily adding a trace in the downloadTemplate function, to see the request it was using to download the template, and trying various new and old forms of the template name. Also created a local template and made sure that still took priority over a remote download.\r\n* I would have liked to add an integration test, but it's hard to test things that download from remote URLs. There isn't currently a way to stub that out.\r\n* Added documentation for the web site in the `doc` subdirectory. Unfortunately I'm not sure how to build that, to make sure it looks right.","created_at":"2018-06-21T05:26:34Z","updated_at":"2018-06-23T03:29:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"24bb19c15be31c4c000abf16038bcacb687ebdb9","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/commercialhaskell/stack/pulls/4103/commits","review_comments_url":"https://api.github.com/repos/commercialhaskell/stack/pulls/4103/comments","review_comment_url":"https://api.github.com/repos/commercialhaskell/stack/pulls/comments{/number}","comments_url":"https://api.github.com/repos/commercialhaskell/stack/issues/4103/comments","statuses_url":"https://api.github.com/repos/commercialhaskell/stack/statuses/2e143182d70a5ee2934db65094b9f704eb73fc10","head":{"label":"lylek:4039-namespaced-templates","ref":"4039-namespaced-templates","sha":"2e143182d70a5ee2934db65094b9f704eb73fc10","user":{"login":"lylek","id":1392658,"node_id":"MDQ6VXNlcjEzOTI2NTg=","avatar_url":"https://avatars2.githubusercontent.com/u/1392658?v=4","gravatar_id":"","url":"https://api.github.com/users/lylek","html_url":"https://github.com/lylek","followers_url":"https://api.github.com/users/lylek/followers","following_url":"https://api.github.com/users/lylek/following{/other_user}","gists_url":"https://api.github.com/users/lylek/gists{/gist_id}","starred_url":"https://api.github.com/users/lylek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lylek/subscriptions","organizations_url":"https://api.github.com/users/lylek/orgs","repos_url":"https://api.github.com/users/lylek/repos","events_url":"https://api.github.com/users/lylek/events{/privacy}","received_events_url":"https://api.github.com/users/lylek/received_events","type":"User","site_admin":false},"repo":{"id":136348136,"node_id":"MDEwOlJlcG9zaXRvcnkxMzYzNDgxMzY=","name":"stack","full_name":"lylek/stack","owner":{"login":"lylek","id":1392658,"node_id":"MDQ6VXNlcjEzOTI2NTg=","avatar_url":"https://avatars2.githubusercontent.com/u/1392658?v=4","gravatar_id":"","url":"https://api.github.com/users/lylek","html_url":"https://github.com/lylek","followers_url":"https://api.github.com/users/lylek/followers","following_url":"https://api.github.com/users/lylek/following{/other_user}","gists_url":"https://api.github.com/users/lylek/gists{/gist_id}","starred_url":"https://api.github.com/users/lylek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lylek/subscriptions","organizations_url":"https://api.github.com/users/lylek/orgs","repos_url":"https://api.github.com/users/lylek/repos","events_url":"https://api.github.com/users/lylek/events{/privacy}","received_events_url":"https://api.github.com/users/lylek/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lylek/stack","description":"The Haskell Tool Stack","fork":true,"url":"https://api.github.com/repos/lylek/stack","forks_url":"https://api.github.com/repos/lylek/stack/forks","keys_url":"https://api.github.com/repos/lylek/stack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lylek/stack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lylek/stack/teams","hooks_url":"https://api.github.com/repos/lylek/stack/hooks","issue_events_url":"https://api.github.com/repos/lylek/stack/issues/events{/number}","events_url":"https://api.github.com/repos/lylek/stack/events","assignees_url":"https://api.github.com/repos/lylek/stack/assignees{/user}","branches_url":"https://api.github.com/repos/lylek/stack/branches{/branch}","tags_url":"https://api.github.com/repos/lylek/stack/tags","blobs_url":"https://api.github.com/repos/lylek/stack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lylek/stack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lylek/stack/git/refs{/sha}","trees_url":"https://api.github.com/repos/lylek/stack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lylek/stack/statuses/{sha}","languages_url":"https://api.github.com/repos/lylek/stack/languages","stargazers_url":"https://api.github.com/repos/lylek/stack/stargazers","contributors_url":"https://api.github.com/repos/lylek/stack/contributors","subscribers_url":"https://api.github.com/repos/lylek/stack/subscribers","subscription_url":"https://api.github.com/repos/lylek/stack/subscription","commits_url":"https://api.github.com/repos/lylek/stack/commits{/sha}","git_commits_url":"https://api.github.com/repos/lylek/stack/git/commits{/sha}","comments_url":"https://api.github.com/repos/lylek/stack/comments{/number}","issue_comment_url":"https://api.github.com/repos/lylek/stack/issues/comments{/number}","contents_url":"https://api.github.com/repos/lylek/stack/contents/{+path}","compare_url":"https://api.github.com/repos/lylek/stack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lylek/stack/merges","archive_url":"https://api.github.com/repos/lylek/stack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lylek/stack/downloads","issues_url":"https://api.github.com/repos/lylek/stack/issues{/number}","pulls_url":"https://api.github.com/repos/lylek/stack/pulls{/number}","milestones_url":"https://api.github.com/repos/lylek/stack/milestones{/number}","notifications_url":"https://api.github.com/repos/lylek/stack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lylek/stack/labels{/name}","releases_url":"https://api.github.com/repos/lylek/stack/releases{/id}","deployments_url":"https://api.github.com/repos/lylek/stack/deployments","created_at":"2018-06-06T15:24:25Z","updated_at":"2018-06-06T15:24:28Z","pushed_at":"2018-06-21T05:23:18Z","git_url":"git://github.com/lylek/stack.git","ssh_url":"git@github.com:lylek/stack.git","clone_url":"https://github.com/lylek/stack.git","svn_url":"https://github.com/lylek/stack","homepage":"http://haskellstack.org","size":12780,"stargazers_count":0,"watchers_count":0,"language":"Haskell","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"commercialhaskell:master","ref":"master","sha":"18c83fffb10931da3357d8d5e17138c2fefa88b3","user":{"login":"commercialhaskell","id":10633049,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNjMzMDQ5","avatar_url":"https://avatars1.githubusercontent.com/u/10633049?v=4","gravatar_id":"","url":"https://api.github.com/users/commercialhaskell","html_url":"https://github.com/commercialhaskell","followers_url":"https://api.github.com/users/commercialhaskell/followers","following_url":"https://api.github.com/users/commercialhaskell/following{/other_user}","gists_url":"https://api.github.com/users/commercialhaskell/gists{/gist_id}","starred_url":"https://api.github.com/users/commercialhaskell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/commercialhaskell/subscriptions","organizations_url":"https://api.github.com/users/commercialhaskell/orgs","repos_url":"https://api.github.com/users/commercialhaskell/repos","events_url":"https://api.github.com/users/commercialhaskell/events{/privacy}","received_events_url":"https://api.github.com/users/commercialhaskell/received_events","type":"Organization","site_admin":false},"repo":{"id":34817922,"node_id":"MDEwOlJlcG9zaXRvcnkzNDgxNzkyMg==","name":"stack","full_name":"commercialhaskell/stack","owner":{"login":"commercialhaskell","id":10633049,"node_id":"MDEyOk9yZ2FuaXphdGlvbjEwNjMzMDQ5","avatar_url":"https://avatars1.githubusercontent.com/u/10633049?v=4","gravatar_id":"","url":"https://api.github.com/users/commercialhaskell","html_url":"https://github.com/commercialhaskell","followers_url":"https://api.github.com/users/commercialhaskell/followers","following_url":"https://api.github.com/users/commercialhaskell/following{/other_user}","gists_url":"https://api.github.com/users/commercialhaskell/gists{/gist_id}","starred_url":"https://api.github.com/users/commercialhaskell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/commercialhaskell/subscriptions","organizations_url":"https://api.github.com/users/commercialhaskell/orgs","repos_url":"https://api.github.com/users/commercialhaskell/repos","events_url":"https://api.github.com/users/commercialhaskell/events{/privacy}","received_events_url":"https://api.github.com/users/commercialhaskell/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/commercialhaskell/stack","description":"The Haskell Tool Stack","fork":false,"url":"https://api.github.com/repos/commercialhaskell/stack","forks_url":"https://api.github.com/repos/commercialhaskell/stack/forks","keys_url":"https://api.github.com/repos/commercialhaskell/stack/keys{/key_id}","collaborators_url":"https://api.github.com/repos/commercialhaskell/stack/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/commercialhaskell/stack/teams","hooks_url":"https://api.github.com/repos/commercialhaskell/stack/hooks","issue_events_url":"https://api.github.com/repos/commercialhaskell/stack/issues/events{/number}","events_url":"https://api.github.com/repos/commercialhaskell/stack/events","assignees_url":"https://api.github.com/repos/commercialhaskell/stack/assignees{/user}","branches_url":"https://api.github.com/repos/commercialhaskell/stack/branches{/branch}","tags_url":"https://api.github.com/repos/commercialhaskell/stack/tags","blobs_url":"https://api.github.com/repos/commercialhaskell/stack/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/commercialhaskell/stack/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/commercialhaskell/stack/git/refs{/sha}","trees_url":"https://api.github.com/repos/commercialhaskell/stack/git/trees{/sha}","statuses_url":"https://api.github.com/repos/commercialhaskell/stack/statuses/{sha}","languages_url":"https://api.github.com/repos/commercialhaskell/stack/languages","stargazers_url":"https://api.github.com/repos/commercialhaskell/stack/stargazers","contributors_url":"https://api.github.com/repos/commercialhaskell/stack/contributors","subscribers_url":"https://api.github.com/repos/commercialhaskell/stack/subscribers","subscription_url":"https://api.github.com/repos/commercialhaskell/stack/subscription","commits_url":"https://api.github.com/repos/commercialhaskell/stack/commits{/sha}","git_commits_url":"https://api.github.com/repos/commercialhaskell/stack/git/commits{/sha}","comments_url":"https://api.github.com/repos/commercialhaskell/stack/comments{/number}","issue_comment_url":"https://api.github.com/repos/commercialhaskell/stack/issues/comments{/number}","contents_url":"https://api.github.com/repos/commercialhaskell/stack/contents/{+path}","compare_url":"https://api.github.com/repos/commercialhaskell/stack/compare/{base}...{head}","merges_url":"https://api.github.com/repos/commercialhaskell/stack/merges","archive_url":"https://api.github.com/repos/commercialhaskell/stack/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/commercialhaskell/stack/downloads","issues_url":"https://api.github.com/repos/commercialhaskell/stack/issues{/number}","pulls_url":"https://api.github.com/repos/commercialhaskell/stack/pulls{/number}","milestones_url":"https://api.github.com/repos/commercialhaskell/stack/milestones{/number}","notifications_url":"https://api.github.com/repos/commercialhaskell/stack/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/commercialhaskell/stack/labels{/name}","releases_url":"https://api.github.com/repos/commercialhaskell/stack/releases{/id}","deployments_url":"https://api.github.com/repos/commercialhaskell/stack/deployments","created_at":"2015-04-29T20:56:42Z","updated_at":"2018-06-23T02:43:52Z","pushed_at":"2018-06-23T00:13:10Z","git_url":"git://github.com/commercialhaskell/stack.git","ssh_url":"git@github.com:commercialhaskell/stack.git","clone_url":"https://github.com/commercialhaskell/stack.git","svn_url":"https://github.com/commercialhaskell/stack","homepage":"http://haskellstack.org","size":12887,"stargazers_count":2728,"watchers_count":2728,"language":"Haskell","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":587,"mirror_url":null,"archived":false,"open_issues_count":767,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":587,"open_issues":767,"watchers":2728,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/commercialhaskell/stack/pulls/4103"},"html":{"href":"https://github.com/commercialhaskell/stack/pull/4103"},"issue":{"href":"https://api.github.com/repos/commercialhaskell/stack/issues/4103"},"comments":{"href":"https://api.github.com/repos/commercialhaskell/stack/issues/4103/comments"},"review_comments":{"href":"https://api.github.com/repos/commercialhaskell/stack/pulls/4103/comments"},"review_comment":{"href":"https://api.github.com/repos/commercialhaskell/stack/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/commercialhaskell/stack/pulls/4103/commits"},"statuses":{"href":"https://api.github.com/repos/commercialhaskell/stack/statuses/2e143182d70a5ee2934db65094b9f704eb73fc10"}},"author_association":"NONE"}}
{"actor":{"display_login":"johnmendonca"}}