{"action":"created","comment":{"url":"https://api.github.com/repos/github/git-lfs/pulls/comments/86342640","pull_request_review_id":7005086,"id":86342640,"diff_hunk":"@@ -0,0 +1,114 @@\n+package git\n+\n+import (\n+\t\"bufio\"\n+\t\"errors\"\n+\t\"fmt\"\n+\t\"io\"\n+\t\"io/ioutil\"\n+\t\"strconv\"\n+\t\"strings\"\n+)\n+\n+type protocol struct {\n+\tr *bufio.Reader\n+\tw *bufio.Writer\n+}\n+\n+func newProtocolRW(r io.Reader, w io.Writer) *protocol {\n+\treturn &protocol{\n+\t\tr: bufio.NewReader(r),\n+\t\tw: bufio.NewWriter(w),\n+\t}\n+}\n+\n+func (p *protocol) readPacket() ([]byte, error) {\n+\tpktLenHex, err := ioutil.ReadAll(io.LimitReader(p.r, 4))\n+\tif err != nil || len(pktLenHex) != 4 { // TODO check pktLenHex length\n+\t\treturn nil, err\n+\t}\n+\n+\tpktLen, err := strconv.ParseInt(string(pktLenHex), 16, 0)\n+\tif err != nil {\n+\t\treturn nil, err\n+\t}\n+\n+\tif pktLen == 0 {\n+\t\treturn nil, nil","path":"git/filter_protocol.go","position":37,"original_position":37,"commit_id":"1d184f7b68aceafa8e8befc0541092b41aad89ee","original_commit_id":"1d184f7b68aceafa8e8befc0541092b41aad89ee","user":{"login":"larsxschneider","id":477434,"avatar_url":"https://avatars.githubusercontent.com/u/477434?v=3","gravatar_id":"","url":"https://api.github.com/users/larsxschneider","html_url":"https://github.com/larsxschneider","followers_url":"https://api.github.com/users/larsxschneider/followers","following_url":"https://api.github.com/users/larsxschneider/following{/other_user}","gists_url":"https://api.github.com/users/larsxschneider/gists{/gist_id}","starred_url":"https://api.github.com/users/larsxschneider/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/larsxschneider/subscriptions","organizations_url":"https://api.github.com/users/larsxschneider/orgs","repos_url":"https://api.github.com/users/larsxschneider/repos","events_url":"https://api.github.com/users/larsxschneider/events{/privacy}","received_events_url":"https://api.github.com/users/larsxschneider/received_events","type":"User","site_admin":false},"body":"How do we distinguish between a \"flush\" packet here and \"no\" packet at all?\r\nDo we need that distinction? I am not sure but I think so 🤔 ","created_at":"2016-11-03T13:36:46Z","updated_at":"2016-11-03T13:47:24Z","html_url":"https://github.com/github/git-lfs/pull/1619#discussion_r86342640","pull_request_url":"https://api.github.com/repos/github/git-lfs/pulls/1619","_links":{"self":{"href":"https://api.github.com/repos/github/git-lfs/pulls/comments/86342640"},"html":{"href":"https://github.com/github/git-lfs/pull/1619#discussion_r86342640"},"pull_request":{"href":"https://api.github.com/repos/github/git-lfs/pulls/1619"}}},"pull_request":{"url":"https://api.github.com/repos/github/git-lfs/pulls/1619","id":92019893,"html_url":"https://github.com/github/git-lfs/pull/1619","diff_url":"https://github.com/github/git-lfs/pull/1619.diff","patch_url":"https://github.com/github/git-lfs/pull/1619.patch","issue_url":"https://api.github.com/repos/github/git-lfs/issues/1619","number":1619,"state":"open","locked":false,"title":"filter_stream: Protocol unit tests","user":{"login":"ttaylorr","id":443245,"avatar_url":"https://avatars.githubusercontent.com/u/443245?v=3","gravatar_id":"","url":"https://api.github.com/users/ttaylorr","html_url":"https://github.com/ttaylorr","followers_url":"https://api.github.com/users/ttaylorr/followers","following_url":"https://api.github.com/users/ttaylorr/following{/other_user}","gists_url":"https://api.github.com/users/ttaylorr/gists{/gist_id}","starred_url":"https://api.github.com/users/ttaylorr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ttaylorr/subscriptions","organizations_url":"https://api.github.com/users/ttaylorr/orgs","repos_url":"https://api.github.com/users/ttaylorr/repos","events_url":"https://api.github.com/users/ttaylorr/events{/privacy}","received_events_url":"https://api.github.com/users/ttaylorr/received_events","type":"User","site_admin":true},"body":"This pull-request adds unit tests ensuring that the Go implementation of the filter protocol is correct.\r\n\r\nThis PR contains a fair number of changes, so here's the breakdown:\r\n\r\n1. https://github.com/github/git-lfs/commit/8bc726dc87d4763d083c4c958842f48c34db6362: Split the high-level protocol (reading requests, writing responses) from the low-level protocol (reading/writing packets, length headers, chunking large packets, etc). This was done so that the unit tests at each \"strata\" of the protocol could be easily separated, and it hides the underlying implementation of the protocol from the higher-level use cases.\r\n2. https://github.com/github/git-lfs/commit/17f9ead05c0cf3fa81f3d5bbf55a7121b11359bb: add some unit tests for the low-level protocol.\r\n3. https://github.com/github/git-lfs/commit/31d04161d90fc522bcb76e00566eda006979c595: add some unit tests for the high-level protocol.\r\n\r\nThough I should have done this sooner, my plan going forward is to rename these types in a future PR to more accurately reflect what they're used for. The `ObjectScanner` type will actually implement the scanner pattern in a future PR in this series, so that name may end up staying the same.\r\n\r\n---\r\n\r\n/cc @technoweenie @larsxschneider @sinbad @rubyist @sschuberth ","created_at":"2016-11-02T17:39:27Z","updated_at":"2016-11-03T13:47:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d67332a309320fd45fd59ac98423768f6e4823b8","assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/github/git-lfs/milestones/1","html_url":"https://github.com/github/git-lfs/milestones/Filter%20protocol%20support","labels_url":"https://api.github.com/repos/github/git-lfs/milestones/1/labels","id":2110220,"number":1,"title":"Filter protocol support","description":"","creator":{"login":"ttaylorr","id":443245,"avatar_url":"https://avatars.githubusercontent.com/u/443245?v=3","gravatar_id":"","url":"https://api.github.com/users/ttaylorr","html_url":"https://github.com/ttaylorr","followers_url":"https://api.github.com/users/ttaylorr/followers","following_url":"https://api.github.com/users/ttaylorr/following{/other_user}","gists_url":"https://api.github.com/users/ttaylorr/gists{/gist_id}","starred_url":"https://api.github.com/users/ttaylorr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ttaylorr/subscriptions","organizations_url":"https://api.github.com/users/ttaylorr/orgs","repos_url":"https://api.github.com/users/ttaylorr/repos","events_url":"https://api.github.com/users/ttaylorr/events{/privacy}","received_events_url":"https://api.github.com/users/ttaylorr/received_events","type":"User","site_admin":true},"open_issues":4,"closed_issues":1,"state":"open","created_at":"2016-11-02T17:25:24Z","updated_at":"2016-11-03T13:28:50Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/github/git-lfs/pulls/1619/commits","review_comments_url":"https://api.github.com/repos/github/git-lfs/pulls/1619/comments","review_comment_url":"https://api.github.com/repos/github/git-lfs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/github/git-lfs/issues/1619/comments","statuses_url":"https://api.github.com/repos/github/git-lfs/statuses/1d184f7b68aceafa8e8befc0541092b41aad89ee","head":{"label":"github:filter-stream-unit-tests","ref":"filter-stream-unit-tests","sha":"1d184f7b68aceafa8e8befc0541092b41aad89ee","user":{"login":"github","id":9919,"avatar_url":"https://avatars.githubusercontent.com/u/9919?v=3","gravatar_id":"","url":"https://api.github.com/users/github","html_url":"https://github.com/github","followers_url":"https://api.github.com/users/github/followers","following_url":"https://api.github.com/users/github/following{/other_user}","gists_url":"https://api.github.com/users/github/gists{/gist_id}","starred_url":"https://api.github.com/users/github/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/github/subscriptions","organizations_url":"https://api.github.com/users/github/orgs","repos_url":"https://api.github.com/users/github/repos","events_url":"https://api.github.com/users/github/events{/privacy}","received_events_url":"https://api.github.com/users/github/received_events","type":"Organization","site_admin":false},"repo":{"id":13021798,"name":"git-lfs","full_name":"github/git-lfs","owner":{"login":"github","id":9919,"avatar_url":"https://avatars.githubusercontent.com/u/9919?v=3","gravatar_id":"","url":"https://api.github.com/users/github","html_url":"https://github.com/github","followers_url":"https://api.github.com/users/github/followers","following_url":"https://api.github.com/users/github/following{/other_user}","gists_url":"https://api.github.com/users/github/gists{/gist_id}","starred_url":"https://api.github.com/users/github/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/github/subscriptions","organizations_url":"https://api.github.com/users/github/orgs","repos_url":"https://api.github.com/users/github/repos","events_url":"https://api.github.com/users/github/events{/privacy}","received_events_url":"https://api.github.com/users/github/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/github/git-lfs","description":"Git extension for versioning large files","fork":false,"url":"https://api.github.com/repos/github/git-lfs","forks_url":"https://api.github.com/repos/github/git-lfs/forks","keys_url":"https://api.github.com/repos/github/git-lfs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/github/git-lfs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/github/git-lfs/teams","hooks_url":"https://api.github.com/repos/github/git-lfs/hooks","issue_events_url":"https://api.github.com/repos/github/git-lfs/issues/events{/number}","events_url":"https://api.github.com/repos/github/git-lfs/events","assignees_url":"https://api.github.com/repos/github/git-lfs/assignees{/user}","branches_url":"https://api.github.com/repos/github/git-lfs/branches{/branch}","tags_url":"https://api.github.com/repos/github/git-lfs/tags","blobs_url":"https://api.github.com/repos/github/git-lfs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/github/git-lfs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/github/git-lfs/git/refs{/sha}","trees_url":"https://api.github.com/repos/github/git-lfs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/github/git-lfs/statuses/{sha}","languages_url":"https://api.github.com/repos/github/git-lfs/languages","stargazers_url":"https://api.github.com/repos/github/git-lfs/stargazers","contributors_url":"https://api.github.com/repos/github/git-lfs/contributors","subscribers_url":"https://api.github.com/repos/github/git-lfs/subscribers","subscription_url":"https://api.github.com/repos/github/git-lfs/subscription","commits_url":"https://api.github.com/repos/github/git-lfs/commits{/sha}","git_commits_url":"https://api.github.com/repos/github/git-lfs/git/commits{/sha}","comments_url":"https://api.github.com/repos/github/git-lfs/comments{/number}","issue_comment_url":"https://api.github.com/repos/github/git-lfs/issues/comments{/number}","contents_url":"https://api.github.com/repos/github/git-lfs/contents/{+path}","compare_url":"https://api.github.com/repos/github/git-lfs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/github/git-lfs/merges","archive_url":"https://api.github.com/repos/github/git-lfs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/github/git-lfs/downloads","issues_url":"https://api.github.com/repos/github/git-lfs/issues{/number}","pulls_url":"https://api.github.com/repos/github/git-lfs/pulls{/number}","milestones_url":"https://api.github.com/repos/github/git-lfs/milestones{/number}","notifications_url":"https://api.github.com/repos/github/git-lfs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/github/git-lfs/labels{/name}","releases_url":"https://api.github.com/repos/github/git-lfs/releases{/id}","deployments_url":"https://api.github.com/repos/github/git-lfs/deployments","created_at":"2013-09-22T22:03:28Z","updated_at":"2016-11-03T04:47:28Z","pushed_at":"2016-11-03T13:28:52Z","git_url":"git://github.com/github/git-lfs.git","ssh_url":"git@github.com:github/git-lfs.git","clone_url":"https://github.com/github/git-lfs.git","svn_url":"https://github.com/github/git-lfs","homepage":"https://git-lfs.github.com","size":12859,"stargazers_count":4006,"watchers_count":4006,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":578,"mirror_url":null,"open_issues_count":163,"forks":578,"open_issues":163,"watchers":4006,"default_branch":"master"}},"base":{"label":"github:filter-stream-integration","ref":"filter-stream-integration","sha":"3147b5783a4c4834bd92765b1d31cbfa67338210","user":{"login":"github","id":9919,"avatar_url":"https://avatars.githubusercontent.com/u/9919?v=3","gravatar_id":"","url":"https://api.github.com/users/github","html_url":"https://github.com/github","followers_url":"https://api.github.com/users/github/followers","following_url":"https://api.github.com/users/github/following{/other_user}","gists_url":"https://api.github.com/users/github/gists{/gist_id}","starred_url":"https://api.github.com/users/github/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/github/subscriptions","organizations_url":"https://api.github.com/users/github/orgs","repos_url":"https://api.github.com/users/github/repos","events_url":"https://api.github.com/users/github/events{/privacy}","received_events_url":"https://api.github.com/users/github/received_events","type":"Organization","site_admin":false},"repo":{"id":13021798,"name":"git-lfs","full_name":"github/git-lfs","owner":{"login":"github","id":9919,"avatar_url":"https://avatars.githubusercontent.com/u/9919?v=3","gravatar_id":"","url":"https://api.github.com/users/github","html_url":"https://github.com/github","followers_url":"https://api.github.com/users/github/followers","following_url":"https://api.github.com/users/github/following{/other_user}","gists_url":"https://api.github.com/users/github/gists{/gist_id}","starred_url":"https://api.github.com/users/github/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/github/subscriptions","organizations_url":"https://api.github.com/users/github/orgs","repos_url":"https://api.github.com/users/github/repos","events_url":"https://api.github.com/users/github/events{/privacy}","received_events_url":"https://api.github.com/users/github/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/github/git-lfs","description":"Git extension for versioning large files","fork":false,"url":"https://api.github.com/repos/github/git-lfs","forks_url":"https://api.github.com/repos/github/git-lfs/forks","keys_url":"https://api.github.com/repos/github/git-lfs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/github/git-lfs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/github/git-lfs/teams","hooks_url":"https://api.github.com/repos/github/git-lfs/hooks","issue_events_url":"https://api.github.com/repos/github/git-lfs/issues/events{/number}","events_url":"https://api.github.com/repos/github/git-lfs/events","assignees_url":"https://api.github.com/repos/github/git-lfs/assignees{/user}","branches_url":"https://api.github.com/repos/github/git-lfs/branches{/branch}","tags_url":"https://api.github.com/repos/github/git-lfs/tags","blobs_url":"https://api.github.com/repos/github/git-lfs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/github/git-lfs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/github/git-lfs/git/refs{/sha}","trees_url":"https://api.github.com/repos/github/git-lfs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/github/git-lfs/statuses/{sha}","languages_url":"https://api.github.com/repos/github/git-lfs/languages","stargazers_url":"https://api.github.com/repos/github/git-lfs/stargazers","contributors_url":"https://api.github.com/repos/github/git-lfs/contributors","subscribers_url":"https://api.github.com/repos/github/git-lfs/subscribers","subscription_url":"https://api.github.com/repos/github/git-lfs/subscription","commits_url":"https://api.github.com/repos/github/git-lfs/commits{/sha}","git_commits_url":"https://api.github.com/repos/github/git-lfs/git/commits{/sha}","comments_url":"https://api.github.com/repos/github/git-lfs/comments{/number}","issue_comment_url":"https://api.github.com/repos/github/git-lfs/issues/comments{/number}","contents_url":"https://api.github.com/repos/github/git-lfs/contents/{+path}","compare_url":"https://api.github.com/repos/github/git-lfs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/github/git-lfs/merges","archive_url":"https://api.github.com/repos/github/git-lfs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/github/git-lfs/downloads","issues_url":"https://api.github.com/repos/github/git-lfs/issues{/number}","pulls_url":"https://api.github.com/repos/github/git-lfs/pulls{/number}","milestones_url":"https://api.github.com/repos/github/git-lfs/milestones{/number}","notifications_url":"https://api.github.com/repos/github/git-lfs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/github/git-lfs/labels{/name}","releases_url":"https://api.github.com/repos/github/git-lfs/releases{/id}","deployments_url":"https://api.github.com/repos/github/git-lfs/deployments","created_at":"2013-09-22T22:03:28Z","updated_at":"2016-11-03T04:47:28Z","pushed_at":"2016-11-03T13:28:52Z","git_url":"git://github.com/github/git-lfs.git","ssh_url":"git@github.com:github/git-lfs.git","clone_url":"https://github.com/github/git-lfs.git","svn_url":"https://github.com/github/git-lfs","homepage":"https://git-lfs.github.com","size":12859,"stargazers_count":4006,"watchers_count":4006,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":578,"mirror_url":null,"open_issues_count":163,"forks":578,"open_issues":163,"watchers":4006,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/github/git-lfs/pulls/1619"},"html":{"href":"https://github.com/github/git-lfs/pull/1619"},"issue":{"href":"https://api.github.com/repos/github/git-lfs/issues/1619"},"comments":{"href":"https://api.github.com/repos/github/git-lfs/issues/1619/comments"},"review_comments":{"href":"https://api.github.com/repos/github/git-lfs/pulls/1619/comments"},"review_comment":{"href":"https://api.github.com/repos/github/git-lfs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/github/git-lfs/pulls/1619/commits"},"statuses":{"href":"https://api.github.com/repos/github/git-lfs/statuses/1d184f7b68aceafa8e8befc0541092b41aad89ee"}}}}
{"actor":{"display_login":"larsxschneider"}}