{"action":"created","comment":{"url":"https://api.github.com/repos/attic-labs/noms/pulls/comments/76326933","id":76326933,"diff_hunk":"@@ -0,0 +1,179 @@\n+// Copyright 2016 Attic Labs, Inc. All rights reserved.\n+// Licensed under the Apache License, version 2.0:\n+// http://www.apache.org/licenses/LICENSE-2.0\n+\n+package merge\n+\n+import (\n+\t\"testing\"\n+\n+\t\"github.com/attic-labs/noms/go/types\"\n+\t\"github.com/attic-labs/testify/suite\"\n+)\n+\n+func TestThreeWayMapMerge(t *testing.T) {\n+\tsuite.Run(t, &ThreeWayMapMergeSuite{})\n+}\n+\n+func TestThreeWayStructMerge(t *testing.T) {\n+\tsuite.Run(t, &ThreeWayStructMergeSuite{})\n+}\n+\n+type kvs []interface{}\n+\n+func (kv kvs) items() []interface{} {\n+\treturn kv\n+}\n+\n+func (kv kvs) remove(k interface{}) kvs {\n+\tout := make(kvs, 0, len(kv))\n+\tfor i := 0; i < len(kv); i++ {\n+\t\tif kv[i] == k {\n+\t\t\ti++ // skip kv[i] and kv[i+1]\n+\t\t\tcontinue\n+\t\t}\n+\t\tout = append(out, kv[i])\n+\t}\n+\treturn out\n+}\n+\n+func (kv kvs) set(k, v interface{}) kvs {\n+\tout := make(kvs, len(kv))\n+\tfor i := 0; i < len(kv); i++ {\n+\t\tout[i] = kv[i]\n+\t\tif kv[i] == k {\n+\t\t\ti++\n+\t\t\tout[i] = v\n+\t\t}\n+\t}\n+\treturn out\n+}\n+\n+var (\n+\taa1      = kvs{\"a1\", \"a-one\", \"a2\", \"a-two\", \"a3\", \"a-three\", \"a4\", \"a-four\"}\n+\taa1a     = kvs{\"a1\", \"a-one\", \"a2\", \"a-two\", \"a3\", \"a-three-diff\", \"a4\", \"a-four\", \"a6\", \"a-six\"}\n+\taa1b     = kvs{\"a1\", \"a-one\", \"a3\", \"a-three-diff\", \"a4\", \"a-four\", \"a5\", \"a-five\"}\n+\taaMerged = kvs{\"a1\", \"a-one\", \"a3\", \"a-three-diff\", \"a4\", \"a-four\", \"a5\", \"a-five\", \"a6\", \"a-six\"}\n+\n+\tmm1       = kvs{}\n+\tmm1a      = kvs{\"k1\", kvs{\"a\", 0}}\n+\tmm1b      = kvs{\"k1\", kvs{\"b\", 1}}\n+\tmm1Merged = kvs{\"k1\", kvs{\"a\", 0, \"b\", 1}}\n+\n+\tmm2       = kvs{\"k2\", aa1, \"k3\", \"k-three\"}\n+\tmm2a      = kvs{\"k1\", kvs{\"a\", 0}, \"k2\", aa1a, \"k3\", \"k-three\", \"k4\", \"k-four\"}\n+\tmm2b      = kvs{\"k1\", kvs{\"b\", 1}, \"k2\", aa1b}\n+\tmm2Merged = kvs{\"k1\", kvs{\"a\", 0, \"b\", 1}, \"k2\", aaMerged, \"k4\", \"k-four\"}\n+)\n+\n+type ThreeWayKeyValMergeSuite struct {\n+\tThreeWayMergeSuite\n+}\n+\n+type ThreeWayMapMergeSuite struct {\n+\tThreeWayKeyValMergeSuite\n+}\n+\n+func (s *ThreeWayMapMergeSuite) SetupSuite() {\n+\ts.create = func(seq seq) (val types.Value) {","path":"go/merge/three_way_keyval_test.go","position":78,"original_position":78,"commit_id":"eb1023eff3e053ae5afc5d16dfd214b41277a96b","original_commit_id":"eb1023eff3e053ae5afc5d16dfd214b41277a96b","user":{"login":"cmasone-attic","id":13224090,"avatar_url":"https://avatars.githubusercontent.com/u/13224090?v=3","gravatar_id":"","url":"https://api.github.com/users/cmasone-attic","html_url":"https://github.com/cmasone-attic","followers_url":"https://api.github.com/users/cmasone-attic/followers","following_url":"https://api.github.com/users/cmasone-attic/following{/other_user}","gists_url":"https://api.github.com/users/cmasone-attic/gists{/gist_id}","starred_url":"https://api.github.com/users/cmasone-attic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmasone-attic/subscriptions","organizations_url":"https://api.github.com/users/cmasone-attic/orgs","repos_url":"https://api.github.com/users/cmasone-attic/repos","events_url":"https://api.github.com/users/cmasone-attic/events{/privacy}","received_events_url":"https://api.github.com/users/cmasone-attic/received_events","type":"User","site_admin":false},"body":"Sadly, Go no likey","created_at":"2016-08-25T21:20:15Z","updated_at":"2016-08-25T21:20:15Z","html_url":"https://github.com/attic-labs/noms/pull/2438#discussion_r76326933","pull_request_url":"https://api.github.com/repos/attic-labs/noms/pulls/2438","_links":{"self":{"href":"https://api.github.com/repos/attic-labs/noms/pulls/comments/76326933"},"html":{"href":"https://github.com/attic-labs/noms/pull/2438#discussion_r76326933"},"pull_request":{"href":"https://api.github.com/repos/attic-labs/noms/pulls/2438"}}},"pull_request":{"url":"https://api.github.com/repos/attic-labs/noms/pulls/2438","id":82790654,"html_url":"https://github.com/attic-labs/noms/pull/2438","diff_url":"https://github.com/attic-labs/noms/pull/2438.diff","patch_url":"https://github.com/attic-labs/noms/pull/2438.patch","issue_url":"https://api.github.com/repos/attic-labs/noms/issues/2438","number":2438,"state":"open","locked":false,"title":"Add Set support to merge.ThreeWay","user":{"login":"cmasone-attic","id":13224090,"avatar_url":"https://avatars.githubusercontent.com/u/13224090?v=3","gravatar_id":"","url":"https://api.github.com/users/cmasone-attic","html_url":"https://github.com/cmasone-attic","followers_url":"https://api.github.com/users/cmasone-attic/followers","following_url":"https://api.github.com/users/cmasone-attic/following{/other_user}","gists_url":"https://api.github.com/users/cmasone-attic/gists{/gist_id}","starred_url":"https://api.github.com/users/cmasone-attic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmasone-attic/subscriptions","organizations_url":"https://api.github.com/users/cmasone-attic/orgs","repos_url":"https://api.github.com/users/cmasone-attic/repos","events_url":"https://api.github.com/users/cmasone-attic/events{/privacy}","received_events_url":"https://api.github.com/users/cmasone-attic/received_events","type":"User","site_admin":false},"body":"Toward #148","created_at":"2016-08-25T20:49:05Z","updated_at":"2016-08-25T21:20:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c53746e5b5797d8ac9ab9386610249b5b275ab30","assignee":{"login":"kalman","id":657134,"avatar_url":"https://avatars.githubusercontent.com/u/657134?v=3","gravatar_id":"","url":"https://api.github.com/users/kalman","html_url":"https://github.com/kalman","followers_url":"https://api.github.com/users/kalman/followers","following_url":"https://api.github.com/users/kalman/following{/other_user}","gists_url":"https://api.github.com/users/kalman/gists{/gist_id}","starred_url":"https://api.github.com/users/kalman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kalman/subscriptions","organizations_url":"https://api.github.com/users/kalman/orgs","repos_url":"https://api.github.com/users/kalman/repos","events_url":"https://api.github.com/users/kalman/events{/privacy}","received_events_url":"https://api.github.com/users/kalman/received_events","type":"User","site_admin":false},"assignees":[{"login":"kalman","id":657134,"avatar_url":"https://avatars.githubusercontent.com/u/657134?v=3","gravatar_id":"","url":"https://api.github.com/users/kalman","html_url":"https://github.com/kalman","followers_url":"https://api.github.com/users/kalman/followers","following_url":"https://api.github.com/users/kalman/following{/other_user}","gists_url":"https://api.github.com/users/kalman/gists{/gist_id}","starred_url":"https://api.github.com/users/kalman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kalman/subscriptions","organizations_url":"https://api.github.com/users/kalman/orgs","repos_url":"https://api.github.com/users/kalman/repos","events_url":"https://api.github.com/users/kalman/events{/privacy}","received_events_url":"https://api.github.com/users/kalman/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/attic-labs/noms/pulls/2438/commits","review_comments_url":"https://api.github.com/repos/attic-labs/noms/pulls/2438/comments","review_comment_url":"https://api.github.com/repos/attic-labs/noms/pulls/comments{/number}","comments_url":"https://api.github.com/repos/attic-labs/noms/issues/2438/comments","statuses_url":"https://api.github.com/repos/attic-labs/noms/statuses/eb1023eff3e053ae5afc5d16dfd214b41277a96b","head":{"label":"cmasone-attic:issue148","ref":"issue148","sha":"eb1023eff3e053ae5afc5d16dfd214b41277a96b","user":{"login":"cmasone-attic","id":13224090,"avatar_url":"https://avatars.githubusercontent.com/u/13224090?v=3","gravatar_id":"","url":"https://api.github.com/users/cmasone-attic","html_url":"https://github.com/cmasone-attic","followers_url":"https://api.github.com/users/cmasone-attic/followers","following_url":"https://api.github.com/users/cmasone-attic/following{/other_user}","gists_url":"https://api.github.com/users/cmasone-attic/gists{/gist_id}","starred_url":"https://api.github.com/users/cmasone-attic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmasone-attic/subscriptions","organizations_url":"https://api.github.com/users/cmasone-attic/orgs","repos_url":"https://api.github.com/users/cmasone-attic/repos","events_url":"https://api.github.com/users/cmasone-attic/events{/privacy}","received_events_url":"https://api.github.com/users/cmasone-attic/received_events","type":"User","site_admin":false},"repo":{"id":64776588,"name":"noms","full_name":"cmasone-attic/noms","owner":{"login":"cmasone-attic","id":13224090,"avatar_url":"https://avatars.githubusercontent.com/u/13224090?v=3","gravatar_id":"","url":"https://api.github.com/users/cmasone-attic","html_url":"https://github.com/cmasone-attic","followers_url":"https://api.github.com/users/cmasone-attic/followers","following_url":"https://api.github.com/users/cmasone-attic/following{/other_user}","gists_url":"https://api.github.com/users/cmasone-attic/gists{/gist_id}","starred_url":"https://api.github.com/users/cmasone-attic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cmasone-attic/subscriptions","organizations_url":"https://api.github.com/users/cmasone-attic/orgs","repos_url":"https://api.github.com/users/cmasone-attic/repos","events_url":"https://api.github.com/users/cmasone-attic/events{/privacy}","received_events_url":"https://api.github.com/users/cmasone-attic/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cmasone-attic/noms","description":"The versioned, forkable, syncable database","fork":true,"url":"https://api.github.com/repos/cmasone-attic/noms","forks_url":"https://api.github.com/repos/cmasone-attic/noms/forks","keys_url":"https://api.github.com/repos/cmasone-attic/noms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cmasone-attic/noms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cmasone-attic/noms/teams","hooks_url":"https://api.github.com/repos/cmasone-attic/noms/hooks","issue_events_url":"https://api.github.com/repos/cmasone-attic/noms/issues/events{/number}","events_url":"https://api.github.com/repos/cmasone-attic/noms/events","assignees_url":"https://api.github.com/repos/cmasone-attic/noms/assignees{/user}","branches_url":"https://api.github.com/repos/cmasone-attic/noms/branches{/branch}","tags_url":"https://api.github.com/repos/cmasone-attic/noms/tags","blobs_url":"https://api.github.com/repos/cmasone-attic/noms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cmasone-attic/noms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cmasone-attic/noms/git/refs{/sha}","trees_url":"https://api.github.com/repos/cmasone-attic/noms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cmasone-attic/noms/statuses/{sha}","languages_url":"https://api.github.com/repos/cmasone-attic/noms/languages","stargazers_url":"https://api.github.com/repos/cmasone-attic/noms/stargazers","contributors_url":"https://api.github.com/repos/cmasone-attic/noms/contributors","subscribers_url":"https://api.github.com/repos/cmasone-attic/noms/subscribers","subscription_url":"https://api.github.com/repos/cmasone-attic/noms/subscription","commits_url":"https://api.github.com/repos/cmasone-attic/noms/commits{/sha}","git_commits_url":"https://api.github.com/repos/cmasone-attic/noms/git/commits{/sha}","comments_url":"https://api.github.com/repos/cmasone-attic/noms/comments{/number}","issue_comment_url":"https://api.github.com/repos/cmasone-attic/noms/issues/comments{/number}","contents_url":"https://api.github.com/repos/cmasone-attic/noms/contents/{+path}","compare_url":"https://api.github.com/repos/cmasone-attic/noms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cmasone-attic/noms/merges","archive_url":"https://api.github.com/repos/cmasone-attic/noms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cmasone-attic/noms/downloads","issues_url":"https://api.github.com/repos/cmasone-attic/noms/issues{/number}","pulls_url":"https://api.github.com/repos/cmasone-attic/noms/pulls{/number}","milestones_url":"https://api.github.com/repos/cmasone-attic/noms/milestones{/number}","notifications_url":"https://api.github.com/repos/cmasone-attic/noms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cmasone-attic/noms/labels{/name}","releases_url":"https://api.github.com/repos/cmasone-attic/noms/releases{/id}","deployments_url":"https://api.github.com/repos/cmasone-attic/noms/deployments","created_at":"2016-08-02T17:13:26Z","updated_at":"2016-08-02T17:13:27Z","pushed_at":"2016-08-25T21:03:22Z","git_url":"git://github.com/cmasone-attic/noms.git","ssh_url":"git@github.com:cmasone-attic/noms.git","clone_url":"https://github.com/cmasone-attic/noms.git","svn_url":"https://github.com/cmasone-attic/noms","homepage":"","size":25371,"stargazers_count":0,"watchers_count":0,"language":"Go","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":"attic-labs:master","ref":"master","sha":"2f66e677638670297b4317acf3765ab2963da356","user":{"login":"attic-labs","id":12534679,"avatar_url":"https://avatars.githubusercontent.com/u/12534679?v=3","gravatar_id":"","url":"https://api.github.com/users/attic-labs","html_url":"https://github.com/attic-labs","followers_url":"https://api.github.com/users/attic-labs/followers","following_url":"https://api.github.com/users/attic-labs/following{/other_user}","gists_url":"https://api.github.com/users/attic-labs/gists{/gist_id}","starred_url":"https://api.github.com/users/attic-labs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/attic-labs/subscriptions","organizations_url":"https://api.github.com/users/attic-labs/orgs","repos_url":"https://api.github.com/users/attic-labs/repos","events_url":"https://api.github.com/users/attic-labs/events{/privacy}","received_events_url":"https://api.github.com/users/attic-labs/received_events","type":"Organization","site_admin":false},"repo":{"id":36778364,"name":"noms","full_name":"attic-labs/noms","owner":{"login":"attic-labs","id":12534679,"avatar_url":"https://avatars.githubusercontent.com/u/12534679?v=3","gravatar_id":"","url":"https://api.github.com/users/attic-labs","html_url":"https://github.com/attic-labs","followers_url":"https://api.github.com/users/attic-labs/followers","following_url":"https://api.github.com/users/attic-labs/following{/other_user}","gists_url":"https://api.github.com/users/attic-labs/gists{/gist_id}","starred_url":"https://api.github.com/users/attic-labs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/attic-labs/subscriptions","organizations_url":"https://api.github.com/users/attic-labs/orgs","repos_url":"https://api.github.com/users/attic-labs/repos","events_url":"https://api.github.com/users/attic-labs/events{/privacy}","received_events_url":"https://api.github.com/users/attic-labs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/attic-labs/noms","description":"The versioned, forkable, syncable database","fork":false,"url":"https://api.github.com/repos/attic-labs/noms","forks_url":"https://api.github.com/repos/attic-labs/noms/forks","keys_url":"https://api.github.com/repos/attic-labs/noms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/attic-labs/noms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/attic-labs/noms/teams","hooks_url":"https://api.github.com/repos/attic-labs/noms/hooks","issue_events_url":"https://api.github.com/repos/attic-labs/noms/issues/events{/number}","events_url":"https://api.github.com/repos/attic-labs/noms/events","assignees_url":"https://api.github.com/repos/attic-labs/noms/assignees{/user}","branches_url":"https://api.github.com/repos/attic-labs/noms/branches{/branch}","tags_url":"https://api.github.com/repos/attic-labs/noms/tags","blobs_url":"https://api.github.com/repos/attic-labs/noms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/attic-labs/noms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/attic-labs/noms/git/refs{/sha}","trees_url":"https://api.github.com/repos/attic-labs/noms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/attic-labs/noms/statuses/{sha}","languages_url":"https://api.github.com/repos/attic-labs/noms/languages","stargazers_url":"https://api.github.com/repos/attic-labs/noms/stargazers","contributors_url":"https://api.github.com/repos/attic-labs/noms/contributors","subscribers_url":"https://api.github.com/repos/attic-labs/noms/subscribers","subscription_url":"https://api.github.com/repos/attic-labs/noms/subscription","commits_url":"https://api.github.com/repos/attic-labs/noms/commits{/sha}","git_commits_url":"https://api.github.com/repos/attic-labs/noms/git/commits{/sha}","comments_url":"https://api.github.com/repos/attic-labs/noms/comments{/number}","issue_comment_url":"https://api.github.com/repos/attic-labs/noms/issues/comments{/number}","contents_url":"https://api.github.com/repos/attic-labs/noms/contents/{+path}","compare_url":"https://api.github.com/repos/attic-labs/noms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/attic-labs/noms/merges","archive_url":"https://api.github.com/repos/attic-labs/noms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/attic-labs/noms/downloads","issues_url":"https://api.github.com/repos/attic-labs/noms/issues{/number}","pulls_url":"https://api.github.com/repos/attic-labs/noms/pulls{/number}","milestones_url":"https://api.github.com/repos/attic-labs/noms/milestones{/number}","notifications_url":"https://api.github.com/repos/attic-labs/noms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/attic-labs/noms/labels{/name}","releases_url":"https://api.github.com/repos/attic-labs/noms/releases{/id}","deployments_url":"https://api.github.com/repos/attic-labs/noms/deployments","created_at":"2015-06-03T03:44:49Z","updated_at":"2016-08-25T20:06:26Z","pushed_at":"2016-08-25T21:03:23Z","git_url":"git://github.com/attic-labs/noms.git","ssh_url":"git@github.com:attic-labs/noms.git","clone_url":"https://github.com/attic-labs/noms.git","svn_url":"https://github.com/attic-labs/noms","homepage":"","size":28813,"stargazers_count":4086,"watchers_count":4086,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":101,"mirror_url":null,"open_issues_count":197,"forks":101,"open_issues":197,"watchers":4086,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/attic-labs/noms/pulls/2438"},"html":{"href":"https://github.com/attic-labs/noms/pull/2438"},"issue":{"href":"https://api.github.com/repos/attic-labs/noms/issues/2438"},"comments":{"href":"https://api.github.com/repos/attic-labs/noms/issues/2438/comments"},"review_comments":{"href":"https://api.github.com/repos/attic-labs/noms/pulls/2438/comments"},"review_comment":{"href":"https://api.github.com/repos/attic-labs/noms/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/attic-labs/noms/pulls/2438/commits"},"statuses":{"href":"https://api.github.com/repos/attic-labs/noms/statuses/eb1023eff3e053ae5afc5d16dfd214b41277a96b"}}}}
{"actor":{"display_login":"cmasone-attic"}}