{"action":"created","comment":{"url":"https://api.github.com/repos/C5T/Current/pulls/comments/85680598","pull_request_review_id":6382022,"id":85680598,"diff_hunk":"@@ -192,8 +199,16 @@ class FilePersister {\n                 }\n                 head = us;\n                 head_offset = std::streamoff(current_offset) + offset;\n-              } else {\n-                head_offset = 0;\n+              } else if (!value.compare(0, signature_key_length, constants::kSignatureDirective)) {\n+                // The signature could be only at the beginning of the file.\n+                if (current_offset != 0) {\n+                  CURRENT_THROW(InvalidSignaturePosition());\n+                }\n+                auto offset = signature_key_length;\n+                while (offset < value.length() && std::isspace(value[offset])) ++offset;\n+                if (value.compare(offset, signature.length(), signature)) {\n+                  CURRENT_THROW(InvalidStreamSignature());","path":"Blocks/Persistence/file.h","position":80,"original_position":80,"commit_id":"6bd30a9383655470d1fa25fb439f10e9b2fb67e5","original_commit_id":"6bd30a9383655470d1fa25fb439f10e9b2fb67e5","user":{"login":"dkorolev","id":2159447,"avatar_url":"https://avatars.githubusercontent.com/u/2159447?v=3","gravatar_id":"","url":"https://api.github.com/users/dkorolev","html_url":"https://github.com/dkorolev","followers_url":"https://api.github.com/users/dkorolev/followers","following_url":"https://api.github.com/users/dkorolev/following{/other_user}","gists_url":"https://api.github.com/users/dkorolev/gists{/gist_id}","starred_url":"https://api.github.com/users/dkorolev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkorolev/subscriptions","organizations_url":"https://api.github.com/users/dkorolev/orgs","repos_url":"https://api.github.com/users/dkorolev/repos","events_url":"https://api.github.com/users/dkorolev/events{/privacy}","received_events_url":"https://api.github.com/users/dkorolev/received_events","type":"User","site_admin":false},"body":"A diff between old and new signatures would be nice here. I mean, just print them; the user would be able to run `cut` and `jq` on their own.","created_at":"2016-10-31T03:10:36Z","updated_at":"2016-10-31T03:10:36Z","html_url":"https://github.com/C5T/Current/pull/674#discussion_r85680598","pull_request_url":"https://api.github.com/repos/C5T/Current/pulls/674","_links":{"self":{"href":"https://api.github.com/repos/C5T/Current/pulls/comments/85680598"},"html":{"href":"https://github.com/C5T/Current/pull/674#discussion_r85680598"},"pull_request":{"href":"https://api.github.com/repos/C5T/Current/pulls/674"}}},"pull_request":{"url":"https://api.github.com/repos/C5T/Current/pulls/674","id":91251008,"html_url":"https://github.com/C5T/Current/pull/674","diff_url":"https://github.com/C5T/Current/pull/674.diff","patch_url":"https://github.com/C5T/Current/pull/674.patch","issue_url":"https://api.github.com/repos/C5T/Current/issues/674","number":674,"state":"open","locked":false,"title":"Sherlock signature directive","user":{"login":"grixa","id":379025,"avatar_url":"https://avatars.githubusercontent.com/u/379025?v=3","gravatar_id":"","url":"https://api.github.com/users/grixa","html_url":"https://github.com/grixa","followers_url":"https://api.github.com/users/grixa/followers","following_url":"https://api.github.com/users/grixa/following{/other_user}","gists_url":"https://api.github.com/users/grixa/gists{/gist_id}","starred_url":"https://api.github.com/users/grixa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grixa/subscriptions","organizations_url":"https://api.github.com/users/grixa/orgs","repos_url":"https://api.github.com/users/grixa/repos","events_url":"https://api.github.com/users/grixa/events{/privacy}","received_events_url":"https://api.github.com/users/grixa/received_events","type":"User","site_admin":false},"body":"CC @dkorolev @mzhurovich \n","created_at":"2016-10-27T18:02:17Z","updated_at":"2016-10-31T03:16:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"067735881b934bad30282a7739579fa9cb716f74","assignee":{"login":"dkorolev","id":2159447,"avatar_url":"https://avatars.githubusercontent.com/u/2159447?v=3","gravatar_id":"","url":"https://api.github.com/users/dkorolev","html_url":"https://github.com/dkorolev","followers_url":"https://api.github.com/users/dkorolev/followers","following_url":"https://api.github.com/users/dkorolev/following{/other_user}","gists_url":"https://api.github.com/users/dkorolev/gists{/gist_id}","starred_url":"https://api.github.com/users/dkorolev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkorolev/subscriptions","organizations_url":"https://api.github.com/users/dkorolev/orgs","repos_url":"https://api.github.com/users/dkorolev/repos","events_url":"https://api.github.com/users/dkorolev/events{/privacy}","received_events_url":"https://api.github.com/users/dkorolev/received_events","type":"User","site_admin":false},"assignees":[{"login":"dkorolev","id":2159447,"avatar_url":"https://avatars.githubusercontent.com/u/2159447?v=3","gravatar_id":"","url":"https://api.github.com/users/dkorolev","html_url":"https://github.com/dkorolev","followers_url":"https://api.github.com/users/dkorolev/followers","following_url":"https://api.github.com/users/dkorolev/following{/other_user}","gists_url":"https://api.github.com/users/dkorolev/gists{/gist_id}","starred_url":"https://api.github.com/users/dkorolev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dkorolev/subscriptions","organizations_url":"https://api.github.com/users/dkorolev/orgs","repos_url":"https://api.github.com/users/dkorolev/repos","events_url":"https://api.github.com/users/dkorolev/events{/privacy}","received_events_url":"https://api.github.com/users/dkorolev/received_events","type":"User","site_admin":false},{"login":"mzhurovich","id":11226961,"avatar_url":"https://avatars.githubusercontent.com/u/11226961?v=3","gravatar_id":"","url":"https://api.github.com/users/mzhurovich","html_url":"https://github.com/mzhurovich","followers_url":"https://api.github.com/users/mzhurovich/followers","following_url":"https://api.github.com/users/mzhurovich/following{/other_user}","gists_url":"https://api.github.com/users/mzhurovich/gists{/gist_id}","starred_url":"https://api.github.com/users/mzhurovich/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mzhurovich/subscriptions","organizations_url":"https://api.github.com/users/mzhurovich/orgs","repos_url":"https://api.github.com/users/mzhurovich/repos","events_url":"https://api.github.com/users/mzhurovich/events{/privacy}","received_events_url":"https://api.github.com/users/mzhurovich/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/C5T/Current/pulls/674/commits","review_comments_url":"https://api.github.com/repos/C5T/Current/pulls/674/comments","review_comment_url":"https://api.github.com/repos/C5T/Current/pulls/comments{/number}","comments_url":"https://api.github.com/repos/C5T/Current/issues/674/comments","statuses_url":"https://api.github.com/repos/C5T/Current/statuses/6bd30a9383655470d1fa25fb439f10e9b2fb67e5","head":{"label":"grixa:sherlock-signature-directive","ref":"sherlock-signature-directive","sha":"6bd30a9383655470d1fa25fb439f10e9b2fb67e5","user":{"login":"grixa","id":379025,"avatar_url":"https://avatars.githubusercontent.com/u/379025?v=3","gravatar_id":"","url":"https://api.github.com/users/grixa","html_url":"https://github.com/grixa","followers_url":"https://api.github.com/users/grixa/followers","following_url":"https://api.github.com/users/grixa/following{/other_user}","gists_url":"https://api.github.com/users/grixa/gists{/gist_id}","starred_url":"https://api.github.com/users/grixa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grixa/subscriptions","organizations_url":"https://api.github.com/users/grixa/orgs","repos_url":"https://api.github.com/users/grixa/repos","events_url":"https://api.github.com/users/grixa/events{/privacy}","received_events_url":"https://api.github.com/users/grixa/received_events","type":"User","site_admin":false},"repo":{"id":54798594,"name":"Current","full_name":"grixa/Current","owner":{"login":"grixa","id":379025,"avatar_url":"https://avatars.githubusercontent.com/u/379025?v=3","gravatar_id":"","url":"https://api.github.com/users/grixa","html_url":"https://github.com/grixa","followers_url":"https://api.github.com/users/grixa/followers","following_url":"https://api.github.com/users/grixa/following{/other_user}","gists_url":"https://api.github.com/users/grixa/gists{/gist_id}","starred_url":"https://api.github.com/users/grixa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grixa/subscriptions","organizations_url":"https://api.github.com/users/grixa/orgs","repos_url":"https://api.github.com/users/grixa/repos","events_url":"https://api.github.com/users/grixa/events{/privacy}","received_events_url":"https://api.github.com/users/grixa/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/grixa/Current","description":"Data Infrastructure in a Box:","fork":true,"url":"https://api.github.com/repos/grixa/Current","forks_url":"https://api.github.com/repos/grixa/Current/forks","keys_url":"https://api.github.com/repos/grixa/Current/keys{/key_id}","collaborators_url":"https://api.github.com/repos/grixa/Current/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/grixa/Current/teams","hooks_url":"https://api.github.com/repos/grixa/Current/hooks","issue_events_url":"https://api.github.com/repos/grixa/Current/issues/events{/number}","events_url":"https://api.github.com/repos/grixa/Current/events","assignees_url":"https://api.github.com/repos/grixa/Current/assignees{/user}","branches_url":"https://api.github.com/repos/grixa/Current/branches{/branch}","tags_url":"https://api.github.com/repos/grixa/Current/tags","blobs_url":"https://api.github.com/repos/grixa/Current/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/grixa/Current/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/grixa/Current/git/refs{/sha}","trees_url":"https://api.github.com/repos/grixa/Current/git/trees{/sha}","statuses_url":"https://api.github.com/repos/grixa/Current/statuses/{sha}","languages_url":"https://api.github.com/repos/grixa/Current/languages","stargazers_url":"https://api.github.com/repos/grixa/Current/stargazers","contributors_url":"https://api.github.com/repos/grixa/Current/contributors","subscribers_url":"https://api.github.com/repos/grixa/Current/subscribers","subscription_url":"https://api.github.com/repos/grixa/Current/subscription","commits_url":"https://api.github.com/repos/grixa/Current/commits{/sha}","git_commits_url":"https://api.github.com/repos/grixa/Current/git/commits{/sha}","comments_url":"https://api.github.com/repos/grixa/Current/comments{/number}","issue_comment_url":"https://api.github.com/repos/grixa/Current/issues/comments{/number}","contents_url":"https://api.github.com/repos/grixa/Current/contents/{+path}","compare_url":"https://api.github.com/repos/grixa/Current/compare/{base}...{head}","merges_url":"https://api.github.com/repos/grixa/Current/merges","archive_url":"https://api.github.com/repos/grixa/Current/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/grixa/Current/downloads","issues_url":"https://api.github.com/repos/grixa/Current/issues{/number}","pulls_url":"https://api.github.com/repos/grixa/Current/pulls{/number}","milestones_url":"https://api.github.com/repos/grixa/Current/milestones{/number}","notifications_url":"https://api.github.com/repos/grixa/Current/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/grixa/Current/labels{/name}","releases_url":"https://api.github.com/repos/grixa/Current/releases{/id}","deployments_url":"https://api.github.com/repos/grixa/Current/deployments","created_at":"2016-03-26T20:39:57Z","updated_at":"2016-03-26T20:39:58Z","pushed_at":"2016-10-30T21:35:46Z","git_url":"git://github.com/grixa/Current.git","ssh_url":"git@github.com:grixa/Current.git","clone_url":"https://github.com/grixa/Current.git","svn_url":"https://github.com/grixa/Current","homepage":"https://j.mp/currentintelligence","size":12544,"stargazers_count":0,"watchers_count":0,"language":"C++","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":"C5T:master","ref":"master","sha":"0aa9f565c1aeb47e83d031ff3bea3c6ca388f78c","user":{"login":"C5T","id":12224789,"avatar_url":"https://avatars.githubusercontent.com/u/12224789?v=3","gravatar_id":"","url":"https://api.github.com/users/C5T","html_url":"https://github.com/C5T","followers_url":"https://api.github.com/users/C5T/followers","following_url":"https://api.github.com/users/C5T/following{/other_user}","gists_url":"https://api.github.com/users/C5T/gists{/gist_id}","starred_url":"https://api.github.com/users/C5T/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/C5T/subscriptions","organizations_url":"https://api.github.com/users/C5T/orgs","repos_url":"https://api.github.com/users/C5T/repos","events_url":"https://api.github.com/users/C5T/events{/privacy}","received_events_url":"https://api.github.com/users/C5T/received_events","type":"Organization","site_admin":false},"repo":{"id":27625425,"name":"Current","full_name":"C5T/Current","owner":{"login":"C5T","id":12224789,"avatar_url":"https://avatars.githubusercontent.com/u/12224789?v=3","gravatar_id":"","url":"https://api.github.com/users/C5T","html_url":"https://github.com/C5T","followers_url":"https://api.github.com/users/C5T/followers","following_url":"https://api.github.com/users/C5T/following{/other_user}","gists_url":"https://api.github.com/users/C5T/gists{/gist_id}","starred_url":"https://api.github.com/users/C5T/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/C5T/subscriptions","organizations_url":"https://api.github.com/users/C5T/orgs","repos_url":"https://api.github.com/users/C5T/repos","events_url":"https://api.github.com/users/C5T/events{/privacy}","received_events_url":"https://api.github.com/users/C5T/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/C5T/Current","description":"Data Infrastructure in a Box.","fork":false,"url":"https://api.github.com/repos/C5T/Current","forks_url":"https://api.github.com/repos/C5T/Current/forks","keys_url":"https://api.github.com/repos/C5T/Current/keys{/key_id}","collaborators_url":"https://api.github.com/repos/C5T/Current/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/C5T/Current/teams","hooks_url":"https://api.github.com/repos/C5T/Current/hooks","issue_events_url":"https://api.github.com/repos/C5T/Current/issues/events{/number}","events_url":"https://api.github.com/repos/C5T/Current/events","assignees_url":"https://api.github.com/repos/C5T/Current/assignees{/user}","branches_url":"https://api.github.com/repos/C5T/Current/branches{/branch}","tags_url":"https://api.github.com/repos/C5T/Current/tags","blobs_url":"https://api.github.com/repos/C5T/Current/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/C5T/Current/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/C5T/Current/git/refs{/sha}","trees_url":"https://api.github.com/repos/C5T/Current/git/trees{/sha}","statuses_url":"https://api.github.com/repos/C5T/Current/statuses/{sha}","languages_url":"https://api.github.com/repos/C5T/Current/languages","stargazers_url":"https://api.github.com/repos/C5T/Current/stargazers","contributors_url":"https://api.github.com/repos/C5T/Current/contributors","subscribers_url":"https://api.github.com/repos/C5T/Current/subscribers","subscription_url":"https://api.github.com/repos/C5T/Current/subscription","commits_url":"https://api.github.com/repos/C5T/Current/commits{/sha}","git_commits_url":"https://api.github.com/repos/C5T/Current/git/commits{/sha}","comments_url":"https://api.github.com/repos/C5T/Current/comments{/number}","issue_comment_url":"https://api.github.com/repos/C5T/Current/issues/comments{/number}","contents_url":"https://api.github.com/repos/C5T/Current/contents/{+path}","compare_url":"https://api.github.com/repos/C5T/Current/compare/{base}...{head}","merges_url":"https://api.github.com/repos/C5T/Current/merges","archive_url":"https://api.github.com/repos/C5T/Current/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/C5T/Current/downloads","issues_url":"https://api.github.com/repos/C5T/Current/issues{/number}","pulls_url":"https://api.github.com/repos/C5T/Current/pulls{/number}","milestones_url":"https://api.github.com/repos/C5T/Current/milestones{/number}","notifications_url":"https://api.github.com/repos/C5T/Current/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/C5T/Current/labels{/name}","releases_url":"https://api.github.com/repos/C5T/Current/releases{/id}","deployments_url":"https://api.github.com/repos/C5T/Current/deployments","created_at":"2014-12-06T06:52:23Z","updated_at":"2016-10-24T14:02:04Z","pushed_at":"2016-10-30T21:41:06Z","git_url":"git://github.com/C5T/Current.git","ssh_url":"git@github.com:C5T/Current.git","clone_url":"https://github.com/C5T/Current.git","svn_url":"https://github.com/C5T/Current","homepage":"http://dima.ai/static/current.pdf","size":13359,"stargazers_count":29,"watchers_count":29,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":13,"forks":12,"open_issues":13,"watchers":29,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/C5T/Current/pulls/674"},"html":{"href":"https://github.com/C5T/Current/pull/674"},"issue":{"href":"https://api.github.com/repos/C5T/Current/issues/674"},"comments":{"href":"https://api.github.com/repos/C5T/Current/issues/674/comments"},"review_comments":{"href":"https://api.github.com/repos/C5T/Current/pulls/674/comments"},"review_comment":{"href":"https://api.github.com/repos/C5T/Current/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/C5T/Current/pulls/674/commits"},"statuses":{"href":"https://api.github.com/repos/C5T/Current/statuses/6bd30a9383655470d1fa25fb439f10e9b2fb67e5"}}}}
{"actor":{"display_login":"dkorolev"}}