{"action":"created","comment":{"url":"https://api.github.com/repos/ceph/ceph/pulls/comments/48851580","id":48851580,"diff_hunk":"@@ -676,7 +678,39 @@ int main(int argc, char **argv) {\n                 << \" version \" << v << \" to \" << outpath\n                 << std::endl;\n     }\n-  } else if (cmd == \"dump-paxos\") {\n+  } else if (cmd == \"show-versions\") {\n+    string map_type; //map type:osdmap,monmap...\n+    // visible options for this command\n+    po::options_description op_desc(\"Allowed 'show-versions' options\");\n+    op_desc.add_options()\n+      (\"help,h\", \"produce this help message\")\n+      (\"map-type\",po::value<string>(&map_type),\"map_type\");\n+\n+    po::positional_options_description op_positional;\n+    op_positional.add(\"map-type\", 1);\n+\n+    po::variables_map op_vm;\n+    int r = parse_cmd_args(&op_desc, NULL, &op_positional,\n+                           subcmds, &op_vm);\n+    if (r < 0) {\n+      err = -r;\n+      goto done;\n+    }\n+\n+    if (op_vm.count(\"help\") || map_type.empty()) {\n+      usage(argv[0], op_desc);\n+      err = 0;\n+      goto done;\n+    }\n+\n+    unsigned int v_first = 0;\n+    unsigned int v_last = 0;\n+    v_first = st.get(map_type,\"first_committed\");","path":"src/tools/ceph_monstore_tool.cc","position":41,"original_position":41,"commit_id":"c36cc66ded9aa481cce39dcd90f6fe0850a97527","original_commit_id":"c36cc66ded9aa481cce39dcd90f6fe0850a97527","user":{"login":"tchaikov","id":59071,"avatar_url":"https://avatars.githubusercontent.com/u/59071?v=3","gravatar_id":"","url":"https://api.github.com/users/tchaikov","html_url":"https://github.com/tchaikov","followers_url":"https://api.github.com/users/tchaikov/followers","following_url":"https://api.github.com/users/tchaikov/following{/other_user}","gists_url":"https://api.github.com/users/tchaikov/gists{/gist_id}","starred_url":"https://api.github.com/users/tchaikov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tchaikov/subscriptions","organizations_url":"https://api.github.com/users/tchaikov/orgs","repos_url":"https://api.github.com/users/tchaikov/repos","events_url":"https://api.github.com/users/tchaikov/events{/privacy}","received_events_url":"https://api.github.com/users/tchaikov/received_events","type":"User","site_admin":false},"body":"add a space after the comma.","created_at":"2016-01-05T14:52:24Z","updated_at":"2016-01-05T14:52:24Z","html_url":"https://github.com/ceph/ceph/pull/7073#discussion_r48851580","pull_request_url":"https://api.github.com/repos/ceph/ceph/pulls/7073","_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph/pulls/comments/48851580"},"html":{"href":"https://github.com/ceph/ceph/pull/7073#discussion_r48851580"},"pull_request":{"href":"https://api.github.com/repos/ceph/ceph/pulls/7073"}}},"pull_request":{"url":"https://api.github.com/repos/ceph/ceph/pulls/7073","id":54714302,"html_url":"https://github.com/ceph/ceph/pull/7073","diff_url":"https://github.com/ceph/ceph/pull/7073.diff","patch_url":"https://github.com/ceph/ceph/pull/7073.patch","issue_url":"https://api.github.com/repos/ceph/ceph/issues/7073","number":7073,"state":"open","locked":false,"title":"tools: monstore: add 'show-versions' command.","user":{"login":"dllgzcl","id":13918540,"avatar_url":"https://avatars.githubusercontent.com/u/13918540?v=3","gravatar_id":"","url":"https://api.github.com/users/dllgzcl","html_url":"https://github.com/dllgzcl","followers_url":"https://api.github.com/users/dllgzcl/followers","following_url":"https://api.github.com/users/dllgzcl/following{/other_user}","gists_url":"https://api.github.com/users/dllgzcl/gists{/gist_id}","starred_url":"https://api.github.com/users/dllgzcl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dllgzcl/subscriptions","organizations_url":"https://api.github.com/users/dllgzcl/orgs","repos_url":"https://api.github.com/users/dllgzcl/repos","events_url":"https://api.github.com/users/dllgzcl/events{/privacy}","received_events_url":"https://api.github.com/users/dllgzcl/received_events","type":"User","site_admin":false},"body":"Use this tool, we can list the first/last committed version of maps.\r\n\r\nSigned-off-by: Cilang Zhao <zhao.cilang@h3c.com>","created_at":"2015-12-29T09:52:59Z","updated_at":"2016-01-05T14:52:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4d57eeb50728c2f79781270f430de72f8ba1f6ea","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ceph/ceph/pulls/7073/commits","review_comments_url":"https://api.github.com/repos/ceph/ceph/pulls/7073/comments","review_comment_url":"https://api.github.com/repos/ceph/ceph/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ceph/ceph/issues/7073/comments","statuses_url":"https://api.github.com/repos/ceph/ceph/statuses/c36cc66ded9aa481cce39dcd90f6fe0850a97527","head":{"label":"dllgzcl:wip-zcl-show-version","ref":"wip-zcl-show-version","sha":"c36cc66ded9aa481cce39dcd90f6fe0850a97527","user":{"login":"dllgzcl","id":13918540,"avatar_url":"https://avatars.githubusercontent.com/u/13918540?v=3","gravatar_id":"","url":"https://api.github.com/users/dllgzcl","html_url":"https://github.com/dllgzcl","followers_url":"https://api.github.com/users/dllgzcl/followers","following_url":"https://api.github.com/users/dllgzcl/following{/other_user}","gists_url":"https://api.github.com/users/dllgzcl/gists{/gist_id}","starred_url":"https://api.github.com/users/dllgzcl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dllgzcl/subscriptions","organizations_url":"https://api.github.com/users/dllgzcl/orgs","repos_url":"https://api.github.com/users/dllgzcl/repos","events_url":"https://api.github.com/users/dllgzcl/events{/privacy}","received_events_url":"https://api.github.com/users/dllgzcl/received_events","type":"User","site_admin":false},"repo":{"id":42560009,"name":"ceph","full_name":"dllgzcl/ceph","owner":{"login":"dllgzcl","id":13918540,"avatar_url":"https://avatars.githubusercontent.com/u/13918540?v=3","gravatar_id":"","url":"https://api.github.com/users/dllgzcl","html_url":"https://github.com/dllgzcl","followers_url":"https://api.github.com/users/dllgzcl/followers","following_url":"https://api.github.com/users/dllgzcl/following{/other_user}","gists_url":"https://api.github.com/users/dllgzcl/gists{/gist_id}","starred_url":"https://api.github.com/users/dllgzcl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dllgzcl/subscriptions","organizations_url":"https://api.github.com/users/dllgzcl/orgs","repos_url":"https://api.github.com/users/dllgzcl/repos","events_url":"https://api.github.com/users/dllgzcl/events{/privacy}","received_events_url":"https://api.github.com/users/dllgzcl/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dllgzcl/ceph","description":"Ceph is a distributed object, block, and file storage platform ","fork":true,"url":"https://api.github.com/repos/dllgzcl/ceph","forks_url":"https://api.github.com/repos/dllgzcl/ceph/forks","keys_url":"https://api.github.com/repos/dllgzcl/ceph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dllgzcl/ceph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dllgzcl/ceph/teams","hooks_url":"https://api.github.com/repos/dllgzcl/ceph/hooks","issue_events_url":"https://api.github.com/repos/dllgzcl/ceph/issues/events{/number}","events_url":"https://api.github.com/repos/dllgzcl/ceph/events","assignees_url":"https://api.github.com/repos/dllgzcl/ceph/assignees{/user}","branches_url":"https://api.github.com/repos/dllgzcl/ceph/branches{/branch}","tags_url":"https://api.github.com/repos/dllgzcl/ceph/tags","blobs_url":"https://api.github.com/repos/dllgzcl/ceph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dllgzcl/ceph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dllgzcl/ceph/git/refs{/sha}","trees_url":"https://api.github.com/repos/dllgzcl/ceph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dllgzcl/ceph/statuses/{sha}","languages_url":"https://api.github.com/repos/dllgzcl/ceph/languages","stargazers_url":"https://api.github.com/repos/dllgzcl/ceph/stargazers","contributors_url":"https://api.github.com/repos/dllgzcl/ceph/contributors","subscribers_url":"https://api.github.com/repos/dllgzcl/ceph/subscribers","subscription_url":"https://api.github.com/repos/dllgzcl/ceph/subscription","commits_url":"https://api.github.com/repos/dllgzcl/ceph/commits{/sha}","git_commits_url":"https://api.github.com/repos/dllgzcl/ceph/git/commits{/sha}","comments_url":"https://api.github.com/repos/dllgzcl/ceph/comments{/number}","issue_comment_url":"https://api.github.com/repos/dllgzcl/ceph/issues/comments{/number}","contents_url":"https://api.github.com/repos/dllgzcl/ceph/contents/{+path}","compare_url":"https://api.github.com/repos/dllgzcl/ceph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dllgzcl/ceph/merges","archive_url":"https://api.github.com/repos/dllgzcl/ceph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dllgzcl/ceph/downloads","issues_url":"https://api.github.com/repos/dllgzcl/ceph/issues{/number}","pulls_url":"https://api.github.com/repos/dllgzcl/ceph/pulls{/number}","milestones_url":"https://api.github.com/repos/dllgzcl/ceph/milestones{/number}","notifications_url":"https://api.github.com/repos/dllgzcl/ceph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dllgzcl/ceph/labels{/name}","releases_url":"https://api.github.com/repos/dllgzcl/ceph/releases{/id}","created_at":"2015-09-16T02:36:41Z","updated_at":"2015-09-16T02:36:55Z","pushed_at":"2016-01-05T06:42:13Z","git_url":"git://github.com/dllgzcl/ceph.git","ssh_url":"git@github.com:dllgzcl/ceph.git","clone_url":"https://github.com/dllgzcl/ceph.git","svn_url":"https://github.com/dllgzcl/ceph","homepage":"http://ceph.com","size":146427,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"ceph:master","ref":"master","sha":"089e1a2baf82505aa47b8fbce380450ca526e6ce","user":{"login":"ceph","id":1015767,"avatar_url":"https://avatars.githubusercontent.com/u/1015767?v=3","gravatar_id":"","url":"https://api.github.com/users/ceph","html_url":"https://github.com/ceph","followers_url":"https://api.github.com/users/ceph/followers","following_url":"https://api.github.com/users/ceph/following{/other_user}","gists_url":"https://api.github.com/users/ceph/gists{/gist_id}","starred_url":"https://api.github.com/users/ceph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceph/subscriptions","organizations_url":"https://api.github.com/users/ceph/orgs","repos_url":"https://api.github.com/users/ceph/repos","events_url":"https://api.github.com/users/ceph/events{/privacy}","received_events_url":"https://api.github.com/users/ceph/received_events","type":"Organization","site_admin":false},"repo":{"id":2310495,"name":"ceph","full_name":"ceph/ceph","owner":{"login":"ceph","id":1015767,"avatar_url":"https://avatars.githubusercontent.com/u/1015767?v=3","gravatar_id":"","url":"https://api.github.com/users/ceph","html_url":"https://github.com/ceph","followers_url":"https://api.github.com/users/ceph/followers","following_url":"https://api.github.com/users/ceph/following{/other_user}","gists_url":"https://api.github.com/users/ceph/gists{/gist_id}","starred_url":"https://api.github.com/users/ceph/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceph/subscriptions","organizations_url":"https://api.github.com/users/ceph/orgs","repos_url":"https://api.github.com/users/ceph/repos","events_url":"https://api.github.com/users/ceph/events{/privacy}","received_events_url":"https://api.github.com/users/ceph/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ceph/ceph","description":"Ceph is a distributed object, block, and file storage platform ","fork":false,"url":"https://api.github.com/repos/ceph/ceph","forks_url":"https://api.github.com/repos/ceph/ceph/forks","keys_url":"https://api.github.com/repos/ceph/ceph/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ceph/ceph/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ceph/ceph/teams","hooks_url":"https://api.github.com/repos/ceph/ceph/hooks","issue_events_url":"https://api.github.com/repos/ceph/ceph/issues/events{/number}","events_url":"https://api.github.com/repos/ceph/ceph/events","assignees_url":"https://api.github.com/repos/ceph/ceph/assignees{/user}","branches_url":"https://api.github.com/repos/ceph/ceph/branches{/branch}","tags_url":"https://api.github.com/repos/ceph/ceph/tags","blobs_url":"https://api.github.com/repos/ceph/ceph/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ceph/ceph/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ceph/ceph/git/refs{/sha}","trees_url":"https://api.github.com/repos/ceph/ceph/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ceph/ceph/statuses/{sha}","languages_url":"https://api.github.com/repos/ceph/ceph/languages","stargazers_url":"https://api.github.com/repos/ceph/ceph/stargazers","contributors_url":"https://api.github.com/repos/ceph/ceph/contributors","subscribers_url":"https://api.github.com/repos/ceph/ceph/subscribers","subscription_url":"https://api.github.com/repos/ceph/ceph/subscription","commits_url":"https://api.github.com/repos/ceph/ceph/commits{/sha}","git_commits_url":"https://api.github.com/repos/ceph/ceph/git/commits{/sha}","comments_url":"https://api.github.com/repos/ceph/ceph/comments{/number}","issue_comment_url":"https://api.github.com/repos/ceph/ceph/issues/comments{/number}","contents_url":"https://api.github.com/repos/ceph/ceph/contents/{+path}","compare_url":"https://api.github.com/repos/ceph/ceph/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ceph/ceph/merges","archive_url":"https://api.github.com/repos/ceph/ceph/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ceph/ceph/downloads","issues_url":"https://api.github.com/repos/ceph/ceph/issues{/number}","pulls_url":"https://api.github.com/repos/ceph/ceph/pulls{/number}","milestones_url":"https://api.github.com/repos/ceph/ceph/milestones{/number}","notifications_url":"https://api.github.com/repos/ceph/ceph/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ceph/ceph/labels{/name}","releases_url":"https://api.github.com/repos/ceph/ceph/releases{/id}","created_at":"2011-09-01T21:41:26Z","updated_at":"2016-01-05T13:02:06Z","pushed_at":"2016-01-05T14:47:30Z","git_url":"git://github.com/ceph/ceph.git","ssh_url":"git@github.com:ceph/ceph.git","clone_url":"https://github.com/ceph/ceph.git","svn_url":"https://github.com/ceph/ceph","homepage":"http://ceph.com","size":174656,"stargazers_count":1778,"watchers_count":1778,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1069,"mirror_url":null,"open_issues_count":294,"forks":1069,"open_issues":294,"watchers":1778,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ceph/ceph/pulls/7073"},"html":{"href":"https://github.com/ceph/ceph/pull/7073"},"issue":{"href":"https://api.github.com/repos/ceph/ceph/issues/7073"},"comments":{"href":"https://api.github.com/repos/ceph/ceph/issues/7073/comments"},"review_comments":{"href":"https://api.github.com/repos/ceph/ceph/pulls/7073/comments"},"review_comment":{"href":"https://api.github.com/repos/ceph/ceph/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ceph/ceph/pulls/7073/commits"},"statuses":{"href":"https://api.github.com/repos/ceph/ceph/statuses/c36cc66ded9aa481cce39dcd90f6fe0850a97527"}}}}