{"action":"created","comment":{"url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/pulls/comments/237580609","pull_request_review_id":179915242,"id":237580609,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNzU4MDYwOQ==","diff_hunk":"@@ -213,6 +214,71 @@ void MonitorManager::removeMonitor(HSMonitor* monitor)\n     monitor_update_focus_objects();\n }\n \n+int MonitorManager::addMonitor(Input input, Output output)\n+{\n+    // usage: add_monitor RECTANGLE [TAG [NAME]]\n+    if (input.size() < 2) {\n+        return HERBST_NEED_MORE_ARGS;\n+    }\n+\n+    input.shift();\n+    auto rect = Rectangle::fromStr(input.front());\n+\n+    input.shift();\n+    HSTag* tag;\n+    if (input.empty()) {\n+        tag = find_unused_tag();\n+        if (!tag) {\n+            output << input.command() << \": There are not enough free tags\\n\";\n+            return HERBST_TAG_IN_USE;\n+        }\n+    } else {\n+        tag = find_tag(input.front().c_str());\n+        if (!tag) {\n+            output << input.command() << \": Tag \\\"\" << input.front() << \"\\\" does not exist\\n\";\n+            return HERBST_INVALID_ARGUMENT;\n+        }\n+        if (find_monitor_with_tag(tag)) {\n+            output << input.command() <<\n+                \": Tag \\\"\" << input.front() << \"\\\" is already being viewed on a monitor\\n\";\n+            return HERBST_TAG_IN_USE;\n+        }\n+    }\n+\n+    input.shift();\n+    std::string name;\n+    if (!input.empty()) {\n+        name = input.front();","path":"src/monitormanager.cpp","position":46,"original_position":46,"commit_id":"47e1fde3c7e1d089395a221e17de722472d3c1d4","original_commit_id":"47e1fde3c7e1d089395a221e17de722472d3c1d4","user":{"login":"ypnos","id":8481470,"node_id":"MDQ6VXNlcjg0ODE0NzA=","avatar_url":"https://avatars1.githubusercontent.com/u/8481470?v=4","gravatar_id":"","url":"https://api.github.com/users/ypnos","html_url":"https://github.com/ypnos","followers_url":"https://api.github.com/users/ypnos/followers","following_url":"https://api.github.com/users/ypnos/following{/other_user}","gists_url":"https://api.github.com/users/ypnos/gists{/gist_id}","starred_url":"https://api.github.com/users/ypnos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ypnos/subscriptions","organizations_url":"https://api.github.com/users/ypnos/orgs","repos_url":"https://api.github.com/users/ypnos/repos","events_url":"https://api.github.com/users/ypnos/events{/privacy}","received_events_url":"https://api.github.com/users/ypnos/received_events","type":"User","site_admin":false},"body":"I really think this is a bad interface (from a C++ point of view) but it serves is purpose to extract several arguments at once. For the single argument case I already intended to propose a `pop()` method that combines front with shift.","created_at":"2018-11-29T17:16:54Z","updated_at":"2018-11-29T17:16:54Z","html_url":"https://github.com/herbstluftwm/herbstluftwm/pull/176#discussion_r237580609","pull_request_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/pulls/176","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/herbstluftwm/herbstluftwm/pulls/comments/237580609"},"html":{"href":"https://github.com/herbstluftwm/herbstluftwm/pull/176#discussion_r237580609"},"pull_request":{"href":"https://api.github.com/repos/herbstluftwm/herbstluftwm/pulls/176"}},"in_reply_to_id":237571119},"pull_request":{"url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/pulls/176","id":234448980,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM0NDQ4OTgw","html_url":"https://github.com/herbstluftwm/herbstluftwm/pull/176","diff_url":"https://github.com/herbstluftwm/herbstluftwm/pull/176.diff","patch_url":"https://github.com/herbstluftwm/herbstluftwm/pull/176.patch","issue_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/issues/176","number":176,"state":"open","locked":false,"title":"Turn add_monitor_command into manager method","user":{"login":"dnnr","id":2630359,"node_id":"MDQ6VXNlcjI2MzAzNTk=","avatar_url":"https://avatars3.githubusercontent.com/u/2630359?v=4","gravatar_id":"","url":"https://api.github.com/users/dnnr","html_url":"https://github.com/dnnr","followers_url":"https://api.github.com/users/dnnr/followers","following_url":"https://api.github.com/users/dnnr/following{/other_user}","gists_url":"https://api.github.com/users/dnnr/gists{/gist_id}","starred_url":"https://api.github.com/users/dnnr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnnr/subscriptions","organizations_url":"https://api.github.com/users/dnnr/orgs","repos_url":"https://api.github.com/users/dnnr/repos","events_url":"https://api.github.com/users/dnnr/events{/privacy}","received_events_url":"https://api.github.com/users/dnnr/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-11-28T22:41:50Z","updated_at":"2018-11-29T17:16:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"002db931d98ee9d3a897dee4c43928a44d1ae585","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/pulls/176/commits","review_comments_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/pulls/176/comments","review_comment_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/pulls/comments{/number}","comments_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/issues/176/comments","statuses_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/statuses/47e1fde3c7e1d089395a221e17de722472d3c1d4","head":{"label":"dnnr:add-monitor-method","ref":"add-monitor-method","sha":"47e1fde3c7e1d089395a221e17de722472d3c1d4","user":{"login":"dnnr","id":2630359,"node_id":"MDQ6VXNlcjI2MzAzNTk=","avatar_url":"https://avatars3.githubusercontent.com/u/2630359?v=4","gravatar_id":"","url":"https://api.github.com/users/dnnr","html_url":"https://github.com/dnnr","followers_url":"https://api.github.com/users/dnnr/followers","following_url":"https://api.github.com/users/dnnr/following{/other_user}","gists_url":"https://api.github.com/users/dnnr/gists{/gist_id}","starred_url":"https://api.github.com/users/dnnr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnnr/subscriptions","organizations_url":"https://api.github.com/users/dnnr/orgs","repos_url":"https://api.github.com/users/dnnr/repos","events_url":"https://api.github.com/users/dnnr/events{/privacy}","received_events_url":"https://api.github.com/users/dnnr/received_events","type":"User","site_admin":false},"repo":{"id":56521901,"node_id":"MDEwOlJlcG9zaXRvcnk1NjUyMTkwMQ==","name":"herbstluftwm","full_name":"dnnr/herbstluftwm","private":false,"owner":{"login":"dnnr","id":2630359,"node_id":"MDQ6VXNlcjI2MzAzNTk=","avatar_url":"https://avatars3.githubusercontent.com/u/2630359?v=4","gravatar_id":"","url":"https://api.github.com/users/dnnr","html_url":"https://github.com/dnnr","followers_url":"https://api.github.com/users/dnnr/followers","following_url":"https://api.github.com/users/dnnr/following{/other_user}","gists_url":"https://api.github.com/users/dnnr/gists{/gist_id}","starred_url":"https://api.github.com/users/dnnr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnnr/subscriptions","organizations_url":"https://api.github.com/users/dnnr/orgs","repos_url":"https://api.github.com/users/dnnr/repos","events_url":"https://api.github.com/users/dnnr/events{/privacy}","received_events_url":"https://api.github.com/users/dnnr/received_events","type":"User","site_admin":false},"html_url":"https://github.com/dnnr/herbstluftwm","description":"A manual tiling window manager for X11","fork":true,"url":"https://api.github.com/repos/dnnr/herbstluftwm","forks_url":"https://api.github.com/repos/dnnr/herbstluftwm/forks","keys_url":"https://api.github.com/repos/dnnr/herbstluftwm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dnnr/herbstluftwm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dnnr/herbstluftwm/teams","hooks_url":"https://api.github.com/repos/dnnr/herbstluftwm/hooks","issue_events_url":"https://api.github.com/repos/dnnr/herbstluftwm/issues/events{/number}","events_url":"https://api.github.com/repos/dnnr/herbstluftwm/events","assignees_url":"https://api.github.com/repos/dnnr/herbstluftwm/assignees{/user}","branches_url":"https://api.github.com/repos/dnnr/herbstluftwm/branches{/branch}","tags_url":"https://api.github.com/repos/dnnr/herbstluftwm/tags","blobs_url":"https://api.github.com/repos/dnnr/herbstluftwm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dnnr/herbstluftwm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dnnr/herbstluftwm/git/refs{/sha}","trees_url":"https://api.github.com/repos/dnnr/herbstluftwm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dnnr/herbstluftwm/statuses/{sha}","languages_url":"https://api.github.com/repos/dnnr/herbstluftwm/languages","stargazers_url":"https://api.github.com/repos/dnnr/herbstluftwm/stargazers","contributors_url":"https://api.github.com/repos/dnnr/herbstluftwm/contributors","subscribers_url":"https://api.github.com/repos/dnnr/herbstluftwm/subscribers","subscription_url":"https://api.github.com/repos/dnnr/herbstluftwm/subscription","commits_url":"https://api.github.com/repos/dnnr/herbstluftwm/commits{/sha}","git_commits_url":"https://api.github.com/repos/dnnr/herbstluftwm/git/commits{/sha}","comments_url":"https://api.github.com/repos/dnnr/herbstluftwm/comments{/number}","issue_comment_url":"https://api.github.com/repos/dnnr/herbstluftwm/issues/comments{/number}","contents_url":"https://api.github.com/repos/dnnr/herbstluftwm/contents/{+path}","compare_url":"https://api.github.com/repos/dnnr/herbstluftwm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dnnr/herbstluftwm/merges","archive_url":"https://api.github.com/repos/dnnr/herbstluftwm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dnnr/herbstluftwm/downloads","issues_url":"https://api.github.com/repos/dnnr/herbstluftwm/issues{/number}","pulls_url":"https://api.github.com/repos/dnnr/herbstluftwm/pulls{/number}","milestones_url":"https://api.github.com/repos/dnnr/herbstluftwm/milestones{/number}","notifications_url":"https://api.github.com/repos/dnnr/herbstluftwm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dnnr/herbstluftwm/labels{/name}","releases_url":"https://api.github.com/repos/dnnr/herbstluftwm/releases{/id}","deployments_url":"https://api.github.com/repos/dnnr/herbstluftwm/deployments","created_at":"2016-04-18T15:59:59Z","updated_at":"2018-11-10T10:55:05Z","pushed_at":"2018-11-29T16:28:31Z","git_url":"git://github.com/dnnr/herbstluftwm.git","ssh_url":"git@github.com:dnnr/herbstluftwm.git","clone_url":"https://github.com/dnnr/herbstluftwm.git","svn_url":"https://github.com/dnnr/herbstluftwm","homepage":"http://www.herbstluftwm.org/","size":2006,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"winterbreeze"}},"base":{"label":"herbstluftwm:winterbreeze","ref":"winterbreeze","sha":"314e14c80d7cbe9279733f10930578660e1ee6f3","user":{"login":"herbstluftwm","id":9048916,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkwNDg5MTY=","avatar_url":"https://avatars1.githubusercontent.com/u/9048916?v=4","gravatar_id":"","url":"https://api.github.com/users/herbstluftwm","html_url":"https://github.com/herbstluftwm","followers_url":"https://api.github.com/users/herbstluftwm/followers","following_url":"https://api.github.com/users/herbstluftwm/following{/other_user}","gists_url":"https://api.github.com/users/herbstluftwm/gists{/gist_id}","starred_url":"https://api.github.com/users/herbstluftwm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/herbstluftwm/subscriptions","organizations_url":"https://api.github.com/users/herbstluftwm/orgs","repos_url":"https://api.github.com/users/herbstluftwm/repos","events_url":"https://api.github.com/users/herbstluftwm/events{/privacy}","received_events_url":"https://api.github.com/users/herbstluftwm/received_events","type":"Organization","site_admin":false},"repo":{"id":24884178,"node_id":"MDEwOlJlcG9zaXRvcnkyNDg4NDE3OA==","name":"herbstluftwm","full_name":"herbstluftwm/herbstluftwm","private":false,"owner":{"login":"herbstluftwm","id":9048916,"node_id":"MDEyOk9yZ2FuaXphdGlvbjkwNDg5MTY=","avatar_url":"https://avatars1.githubusercontent.com/u/9048916?v=4","gravatar_id":"","url":"https://api.github.com/users/herbstluftwm","html_url":"https://github.com/herbstluftwm","followers_url":"https://api.github.com/users/herbstluftwm/followers","following_url":"https://api.github.com/users/herbstluftwm/following{/other_user}","gists_url":"https://api.github.com/users/herbstluftwm/gists{/gist_id}","starred_url":"https://api.github.com/users/herbstluftwm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/herbstluftwm/subscriptions","organizations_url":"https://api.github.com/users/herbstluftwm/orgs","repos_url":"https://api.github.com/users/herbstluftwm/repos","events_url":"https://api.github.com/users/herbstluftwm/events{/privacy}","received_events_url":"https://api.github.com/users/herbstluftwm/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/herbstluftwm/herbstluftwm","description":"A manual tiling window manager for X11","fork":false,"url":"https://api.github.com/repos/herbstluftwm/herbstluftwm","forks_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/forks","keys_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/keys{/key_id}","collaborators_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/teams","hooks_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/hooks","issue_events_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/issues/events{/number}","events_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/events","assignees_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/assignees{/user}","branches_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/branches{/branch}","tags_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/tags","blobs_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/git/refs{/sha}","trees_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/git/trees{/sha}","statuses_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/statuses/{sha}","languages_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/languages","stargazers_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/stargazers","contributors_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/contributors","subscribers_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/subscribers","subscription_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/subscription","commits_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/commits{/sha}","git_commits_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/git/commits{/sha}","comments_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/comments{/number}","issue_comment_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/issues/comments{/number}","contents_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/contents/{+path}","compare_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/compare/{base}...{head}","merges_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/merges","archive_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/downloads","issues_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/issues{/number}","pulls_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/pulls{/number}","milestones_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/milestones{/number}","notifications_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/labels{/name}","releases_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/releases{/id}","deployments_url":"https://api.github.com/repos/herbstluftwm/herbstluftwm/deployments","created_at":"2014-10-07T09:27:20Z","updated_at":"2018-11-29T07:01:31Z","pushed_at":"2018-11-29T16:44:20Z","git_url":"git://github.com/herbstluftwm/herbstluftwm.git","ssh_url":"git@github.com:herbstluftwm/herbstluftwm.git","clone_url":"https://github.com/herbstluftwm/herbstluftwm.git","svn_url":"https://github.com/herbstluftwm/herbstluftwm","homepage":"http://www.herbstluftwm.org/","size":1939,"stargazers_count":316,"watchers_count":316,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":40,"mirror_url":null,"archived":false,"open_issues_count":66,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":40,"open_issues":66,"watchers":316,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/herbstluftwm/herbstluftwm/pulls/176"},"html":{"href":"https://github.com/herbstluftwm/herbstluftwm/pull/176"},"issue":{"href":"https://api.github.com/repos/herbstluftwm/herbstluftwm/issues/176"},"comments":{"href":"https://api.github.com/repos/herbstluftwm/herbstluftwm/issues/176/comments"},"review_comments":{"href":"https://api.github.com/repos/herbstluftwm/herbstluftwm/pulls/176/comments"},"review_comment":{"href":"https://api.github.com/repos/herbstluftwm/herbstluftwm/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/herbstluftwm/herbstluftwm/pulls/176/commits"},"statuses":{"href":"https://api.github.com/repos/herbstluftwm/herbstluftwm/statuses/47e1fde3c7e1d089395a221e17de722472d3c1d4"}},"author_association":"NONE"}}
{"actor":{"display_login":"ypnos"}}