{"action":"created","comment":{"url":"https://api.github.com/repos/docker/docker/pulls/comments/45135330","id":45135330,"diff_hunk":"@@ -226,6 +233,74 @@ func (p *v2Pusher) pushV2Tag(tag string) error {\n \treturn manSvc.Put(signed)\n }\n \n+func fixHistory(m *schema1.Manifest) error {\n+\tvar lastID string\n+\n+\tfor i := len(m.History) - 1; i >= 0; i-- {\n+\t\tvar historyEntry map[string]*json.RawMessage\n+\t\tif err := json.Unmarshal([]byte(m.History[i].V1Compatibility), &historyEntry); err != nil {\n+\t\t\treturn err\n+\t\t}\n+\n+\t\tidJSON, present := historyEntry[\"id\"]\n+\t\tif !present || idJSON == nil {\n+\t\t\treturn errors.New(\"missing id key in v1compatibility file\")\n+\t\t}\n+\t\tvar id string\n+\t\tif err := json.Unmarshal(*idJSON, &id); err != nil {\n+\t\t\treturn err\n+\t\t}\n+\n+\t\tparentJSON, present := historyEntry[\"parent\"]\n+\n+\t\tif i == len(m.History)-1 {","path":"graph/push_v2.go","position":45,"original_position":45,"commit_id":"0e4550ba1f244df8d694f742be371be36d7c6cb4","original_commit_id":"0e4550ba1f244df8d694f742be371be36d7c6cb4","user":{"login":"LK4D4","id":101445,"avatar_url":"https://avatars.githubusercontent.com/u/101445?v=3","gravatar_id":"","url":"https://api.github.com/users/LK4D4","html_url":"https://github.com/LK4D4","followers_url":"https://api.github.com/users/LK4D4/followers","following_url":"https://api.github.com/users/LK4D4/following{/other_user}","gists_url":"https://api.github.com/users/LK4D4/gists{/gist_id}","starred_url":"https://api.github.com/users/LK4D4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LK4D4/subscriptions","organizations_url":"https://api.github.com/users/LK4D4/orgs","repos_url":"https://api.github.com/users/LK4D4/repos","events_url":"https://api.github.com/users/LK4D4/events{/privacy}","received_events_url":"https://api.github.com/users/LK4D4/received_events","type":"User","site_admin":false},"body":"It's better to write comment why first image need special code.","created_at":"2015-11-17T22:55:24Z","updated_at":"2015-11-17T22:55:24Z","html_url":"https://github.com/docker/docker/pull/18047#discussion_r45135330","pull_request_url":"https://api.github.com/repos/docker/docker/pulls/18047","_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/comments/45135330"},"html":{"href":"https://github.com/docker/docker/pull/18047#discussion_r45135330"},"pull_request":{"href":"https://api.github.com/repos/docker/docker/pulls/18047"}}},"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/18047","id":50998616,"html_url":"https://github.com/docker/docker/pull/18047","diff_url":"https://github.com/docker/docker/pull/18047.diff","patch_url":"https://github.com/docker/docker/pull/18047.patch","issue_url":"https://api.github.com/repos/docker/docker/issues/18047","number":18047,"state":"open","locked":false,"title":"Correct parent chain in v2 push when v1Compatibility files on the disk are inconsistent","user":{"login":"aaronlehmann","id":10601430,"avatar_url":"https://avatars.githubusercontent.com/u/10601430?v=3","gravatar_id":"","url":"https://api.github.com/users/aaronlehmann","html_url":"https://github.com/aaronlehmann","followers_url":"https://api.github.com/users/aaronlehmann/followers","following_url":"https://api.github.com/users/aaronlehmann/following{/other_user}","gists_url":"https://api.github.com/users/aaronlehmann/gists{/gist_id}","starred_url":"https://api.github.com/users/aaronlehmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaronlehmann/subscriptions","organizations_url":"https://api.github.com/users/aaronlehmann/orgs","repos_url":"https://api.github.com/users/aaronlehmann/repos","events_url":"https://api.github.com/users/aaronlehmann/events{/privacy}","received_events_url":"https://api.github.com/users/aaronlehmann/received_events","type":"User","site_admin":false},"body":"This fixes an issue where two images with the same filesystem contents\r\nand configuration but different remote IDs could share a v1Compatibility\r\nfile, resulting in corrupted manifests.\r\n\r\nIt would be great to get this into 1.9.1 if possible.\r\n\r\n@tonistiigi @dmcgowan @tiborvass ","created_at":"2015-11-17T20:17:57Z","updated_at":"2015-11-17T22:55:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f22afe90fe51c0f39f982059a5b200605876840d","assignee":null,"milestone":{"url":"https://api.github.com/repos/docker/docker/milestones/45","html_url":"https://github.com/docker/docker/milestones/1.9.1","labels_url":"https://api.github.com/repos/docker/docker/milestones/45/labels","id":1385783,"number":45,"title":"1.9.1","description":"","creator":{"login":"tiborvass","id":827131,"avatar_url":"https://avatars.githubusercontent.com/u/827131?v=3","gravatar_id":"","url":"https://api.github.com/users/tiborvass","html_url":"https://github.com/tiborvass","followers_url":"https://api.github.com/users/tiborvass/followers","following_url":"https://api.github.com/users/tiborvass/following{/other_user}","gists_url":"https://api.github.com/users/tiborvass/gists{/gist_id}","starred_url":"https://api.github.com/users/tiborvass/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tiborvass/subscriptions","organizations_url":"https://api.github.com/users/tiborvass/orgs","repos_url":"https://api.github.com/users/tiborvass/repos","events_url":"https://api.github.com/users/tiborvass/events{/privacy}","received_events_url":"https://api.github.com/users/tiborvass/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":71,"state":"open","created_at":"2015-10-30T17:08:02Z","updated_at":"2015-11-17T20:19:04Z","due_on":"2015-11-19T05:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/docker/docker/pulls/18047/commits","review_comments_url":"https://api.github.com/repos/docker/docker/pulls/18047/comments","review_comment_url":"https://api.github.com/repos/docker/docker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/docker/issues/18047/comments","statuses_url":"https://api.github.com/repos/docker/docker/statuses/0e4550ba1f244df8d694f742be371be36d7c6cb4","head":{"label":"aaronlehmann:push-fix","ref":"push-fix","sha":"0e4550ba1f244df8d694f742be371be36d7c6cb4","user":{"login":"aaronlehmann","id":10601430,"avatar_url":"https://avatars.githubusercontent.com/u/10601430?v=3","gravatar_id":"","url":"https://api.github.com/users/aaronlehmann","html_url":"https://github.com/aaronlehmann","followers_url":"https://api.github.com/users/aaronlehmann/followers","following_url":"https://api.github.com/users/aaronlehmann/following{/other_user}","gists_url":"https://api.github.com/users/aaronlehmann/gists{/gist_id}","starred_url":"https://api.github.com/users/aaronlehmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaronlehmann/subscriptions","organizations_url":"https://api.github.com/users/aaronlehmann/orgs","repos_url":"https://api.github.com/users/aaronlehmann/repos","events_url":"https://api.github.com/users/aaronlehmann/events{/privacy}","received_events_url":"https://api.github.com/users/aaronlehmann/received_events","type":"User","site_admin":false},"repo":{"id":39463499,"name":"docker","full_name":"aaronlehmann/docker","owner":{"login":"aaronlehmann","id":10601430,"avatar_url":"https://avatars.githubusercontent.com/u/10601430?v=3","gravatar_id":"","url":"https://api.github.com/users/aaronlehmann","html_url":"https://github.com/aaronlehmann","followers_url":"https://api.github.com/users/aaronlehmann/followers","following_url":"https://api.github.com/users/aaronlehmann/following{/other_user}","gists_url":"https://api.github.com/users/aaronlehmann/gists{/gist_id}","starred_url":"https://api.github.com/users/aaronlehmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aaronlehmann/subscriptions","organizations_url":"https://api.github.com/users/aaronlehmann/orgs","repos_url":"https://api.github.com/users/aaronlehmann/repos","events_url":"https://api.github.com/users/aaronlehmann/events{/privacy}","received_events_url":"https://api.github.com/users/aaronlehmann/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aaronlehmann/docker","description":"Docker - the open-source application container engine","fork":true,"url":"https://api.github.com/repos/aaronlehmann/docker","forks_url":"https://api.github.com/repos/aaronlehmann/docker/forks","keys_url":"https://api.github.com/repos/aaronlehmann/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aaronlehmann/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aaronlehmann/docker/teams","hooks_url":"https://api.github.com/repos/aaronlehmann/docker/hooks","issue_events_url":"https://api.github.com/repos/aaronlehmann/docker/issues/events{/number}","events_url":"https://api.github.com/repos/aaronlehmann/docker/events","assignees_url":"https://api.github.com/repos/aaronlehmann/docker/assignees{/user}","branches_url":"https://api.github.com/repos/aaronlehmann/docker/branches{/branch}","tags_url":"https://api.github.com/repos/aaronlehmann/docker/tags","blobs_url":"https://api.github.com/repos/aaronlehmann/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aaronlehmann/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aaronlehmann/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/aaronlehmann/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aaronlehmann/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/aaronlehmann/docker/languages","stargazers_url":"https://api.github.com/repos/aaronlehmann/docker/stargazers","contributors_url":"https://api.github.com/repos/aaronlehmann/docker/contributors","subscribers_url":"https://api.github.com/repos/aaronlehmann/docker/subscribers","subscription_url":"https://api.github.com/repos/aaronlehmann/docker/subscription","commits_url":"https://api.github.com/repos/aaronlehmann/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/aaronlehmann/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/aaronlehmann/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/aaronlehmann/docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/aaronlehmann/docker/contents/{+path}","compare_url":"https://api.github.com/repos/aaronlehmann/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aaronlehmann/docker/merges","archive_url":"https://api.github.com/repos/aaronlehmann/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aaronlehmann/docker/downloads","issues_url":"https://api.github.com/repos/aaronlehmann/docker/issues{/number}","pulls_url":"https://api.github.com/repos/aaronlehmann/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/aaronlehmann/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/aaronlehmann/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aaronlehmann/docker/labels{/name}","releases_url":"https://api.github.com/repos/aaronlehmann/docker/releases{/id}","created_at":"2015-07-21T18:44:59Z","updated_at":"2015-07-21T18:45:07Z","pushed_at":"2015-11-17T20:05:39Z","git_url":"git://github.com/aaronlehmann/docker.git","ssh_url":"git@github.com:aaronlehmann/docker.git","clone_url":"https://github.com/aaronlehmann/docker.git","svn_url":"https://github.com/aaronlehmann/docker","homepage":"http://www.docker.com","size":74816,"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":"docker:master","ref":"master","sha":"aeccd45e5b4074cebb1cbe3bb51b6bde4111048a","user":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"repo":{"id":7691631,"name":"docker","full_name":"docker/docker","owner":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/docker/docker","description":"Docker - the open-source application container engine","fork":false,"url":"https://api.github.com/repos/docker/docker","forks_url":"https://api.github.com/repos/docker/docker/forks","keys_url":"https://api.github.com/repos/docker/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/docker/teams","hooks_url":"https://api.github.com/repos/docker/docker/hooks","issue_events_url":"https://api.github.com/repos/docker/docker/issues/events{/number}","events_url":"https://api.github.com/repos/docker/docker/events","assignees_url":"https://api.github.com/repos/docker/docker/assignees{/user}","branches_url":"https://api.github.com/repos/docker/docker/branches{/branch}","tags_url":"https://api.github.com/repos/docker/docker/tags","blobs_url":"https://api.github.com/repos/docker/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/docker/languages","stargazers_url":"https://api.github.com/repos/docker/docker/stargazers","contributors_url":"https://api.github.com/repos/docker/docker/contributors","subscribers_url":"https://api.github.com/repos/docker/docker/subscribers","subscription_url":"https://api.github.com/repos/docker/docker/subscription","commits_url":"https://api.github.com/repos/docker/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/docker/docker/contents/{+path}","compare_url":"https://api.github.com/repos/docker/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/docker/merges","archive_url":"https://api.github.com/repos/docker/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/docker/downloads","issues_url":"https://api.github.com/repos/docker/docker/issues{/number}","pulls_url":"https://api.github.com/repos/docker/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/docker/labels{/name}","releases_url":"https://api.github.com/repos/docker/docker/releases{/id}","created_at":"2013-01-18T18:10:57Z","updated_at":"2015-11-17T22:05:15Z","pushed_at":"2015-11-17T22:03:51Z","git_url":"git://github.com/docker/docker.git","ssh_url":"git@github.com:docker/docker.git","clone_url":"https://github.com/docker/docker.git","svn_url":"https://github.com/docker/docker","homepage":"http://www.docker.com","size":116426,"stargazers_count":26320,"watchers_count":26320,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":7065,"mirror_url":null,"open_issues_count":1206,"forks":7065,"open_issues":1206,"watchers":26320,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/18047"},"html":{"href":"https://github.com/docker/docker/pull/18047"},"issue":{"href":"https://api.github.com/repos/docker/docker/issues/18047"},"comments":{"href":"https://api.github.com/repos/docker/docker/issues/18047/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/docker/pulls/18047/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/docker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/docker/pulls/18047/commits"},"statuses":{"href":"https://api.github.com/repos/docker/docker/statuses/0e4550ba1f244df8d694f742be371be36d7c6cb4"}}}}