{"action":"created","comment":{"url":"https://api.github.com/repos/docker/docker/pulls/comments/30331995","id":30331995,"diff_hunk":"@@ -308,11 +308,17 @@ func (a *Driver) Put(id string) error {\n \n // Diff produces an archive of the changes between the specified\n // layer and its parent layer which may be \"\".\n-func (a *Driver) Diff(id, parent string) (archive.Archive, error) {\n+func (a *Driver) Diff(id, parent string, excludes []string) (archive.Archive, error) {\n+\t// archive.TarWithOptions uses relative path to compare excludes.\n+\t// So we have to strip the leading '/'.\n+\tnewExcludes := make([]string, len(excludes))\n+\tfor i, ex := range excludes {\n+\t\tnewExcludes[i] = strings.TrimLeft(ex, \"/\")","path":"daemon/graphdriver/aufs/aufs.go","position":10,"original_position":10,"commit_id":"0ed6fbdf0cc7efc6c1a13c9b71d6b96617afd2ed","original_commit_id":"0ed6fbdf0cc7efc6c1a13c9b71d6b96617afd2ed","user":{"login":"duglin","id":1944671,"avatar_url":"https://avatars.githubusercontent.com/u/1944671?v=3","gravatar_id":"","url":"https://api.github.com/users/duglin","html_url":"https://github.com/duglin","followers_url":"https://api.github.com/users/duglin/followers","following_url":"https://api.github.com/users/duglin/following{/other_user}","gists_url":"https://api.github.com/users/duglin/gists{/gist_id}","starred_url":"https://api.github.com/users/duglin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/duglin/subscriptions","organizations_url":"https://api.github.com/users/duglin/orgs","repos_url":"https://api.github.com/users/duglin/repos","events_url":"https://api.github.com/users/duglin/events{/privacy}","received_events_url":"https://api.github.com/users/duglin/received_events","type":"User","site_admin":false},"body":"Do you ever actually check to make sure the incoming paths are absolute?  I didn't notice it. I think we should generate an error if they're not.\r\n\r\nNot 100% sure of the best place to do the check but this func seems reasonable since you want to catch all code paths that might hit this func.  Of course, putting the check in the archive code might not be bad either, since if you're correct that its assuming relative paths then it really should enforce it.","created_at":"2015-05-14T15:44:01Z","updated_at":"2015-05-14T15:44:01Z","html_url":"https://github.com/docker/docker/pull/12594#discussion_r30331995","pull_request_url":"https://api.github.com/repos/docker/docker/pulls/12594","_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/comments/30331995"},"html":{"href":"https://github.com/docker/docker/pull/12594#discussion_r30331995"},"pull_request":{"href":"https://api.github.com/repos/docker/docker/pulls/12594"}}},"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/12594","id":33753647,"html_url":"https://github.com/docker/docker/pull/12594","diff_url":"https://github.com/docker/docker/pull/12594.diff","patch_url":"https://github.com/docker/docker/pull/12594.patch","issue_url":"https://api.github.com/repos/docker/docker/issues/12594","number":12594,"state":"open","locked":false,"title":"Proposal: Add --exclude parameter to docker commit","user":{"login":"mountkin","id":1496652,"avatar_url":"https://avatars.githubusercontent.com/u/1496652?v=3","gravatar_id":"","url":"https://api.github.com/users/mountkin","html_url":"https://github.com/mountkin","followers_url":"https://api.github.com/users/mountkin/followers","following_url":"https://api.github.com/users/mountkin/following{/other_user}","gists_url":"https://api.github.com/users/mountkin/gists{/gist_id}","starred_url":"https://api.github.com/users/mountkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mountkin/subscriptions","organizations_url":"https://api.github.com/users/mountkin/orgs","repos_url":"https://api.github.com/users/mountkin/repos","events_url":"https://api.github.com/users/mountkin/events{/privacy}","received_events_url":"https://api.github.com/users/mountkin/received_events","type":"User","site_admin":false},"body":"Sometimes the container might generate temporary files or unix socket\r\nfiles. Commit those temporary files to the image makes no sense.\r\nI think adding a new parameter to `docker commit` API would be useful in\r\nsuch cases.\r\n\r\nUsage: `docker commit --exclude=/tmp --exclude=/var/run/mysql.sock\r\nyour-container`","created_at":"2015-04-21T11:53:01Z","updated_at":"2015-05-14T15:44:01Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ea001011f058c2a8315e9ecae2e259adec1375f4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/docker/docker/pulls/12594/commits","review_comments_url":"https://api.github.com/repos/docker/docker/pulls/12594/comments","review_comment_url":"https://api.github.com/repos/docker/docker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/docker/issues/12594/comments","statuses_url":"https://api.github.com/repos/docker/docker/statuses/0ed6fbdf0cc7efc6c1a13c9b71d6b96617afd2ed","head":{"label":"mountkin:add-exclude-option","ref":"add-exclude-option","sha":"0ed6fbdf0cc7efc6c1a13c9b71d6b96617afd2ed","user":{"login":"mountkin","id":1496652,"avatar_url":"https://avatars.githubusercontent.com/u/1496652?v=3","gravatar_id":"","url":"https://api.github.com/users/mountkin","html_url":"https://github.com/mountkin","followers_url":"https://api.github.com/users/mountkin/followers","following_url":"https://api.github.com/users/mountkin/following{/other_user}","gists_url":"https://api.github.com/users/mountkin/gists{/gist_id}","starred_url":"https://api.github.com/users/mountkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mountkin/subscriptions","organizations_url":"https://api.github.com/users/mountkin/orgs","repos_url":"https://api.github.com/users/mountkin/repos","events_url":"https://api.github.com/users/mountkin/events{/privacy}","received_events_url":"https://api.github.com/users/mountkin/received_events","type":"User","site_admin":false},"repo":{"id":30530455,"name":"docker","full_name":"mountkin/docker","owner":{"login":"mountkin","id":1496652,"avatar_url":"https://avatars.githubusercontent.com/u/1496652?v=3","gravatar_id":"","url":"https://api.github.com/users/mountkin","html_url":"https://github.com/mountkin","followers_url":"https://api.github.com/users/mountkin/followers","following_url":"https://api.github.com/users/mountkin/following{/other_user}","gists_url":"https://api.github.com/users/mountkin/gists{/gist_id}","starred_url":"https://api.github.com/users/mountkin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mountkin/subscriptions","organizations_url":"https://api.github.com/users/mountkin/orgs","repos_url":"https://api.github.com/users/mountkin/repos","events_url":"https://api.github.com/users/mountkin/events{/privacy}","received_events_url":"https://api.github.com/users/mountkin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mountkin/docker","description":"Docker - the open-source application container engine","fork":true,"url":"https://api.github.com/repos/mountkin/docker","forks_url":"https://api.github.com/repos/mountkin/docker/forks","keys_url":"https://api.github.com/repos/mountkin/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mountkin/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mountkin/docker/teams","hooks_url":"https://api.github.com/repos/mountkin/docker/hooks","issue_events_url":"https://api.github.com/repos/mountkin/docker/issues/events{/number}","events_url":"https://api.github.com/repos/mountkin/docker/events","assignees_url":"https://api.github.com/repos/mountkin/docker/assignees{/user}","branches_url":"https://api.github.com/repos/mountkin/docker/branches{/branch}","tags_url":"https://api.github.com/repos/mountkin/docker/tags","blobs_url":"https://api.github.com/repos/mountkin/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mountkin/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mountkin/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/mountkin/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mountkin/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/mountkin/docker/languages","stargazers_url":"https://api.github.com/repos/mountkin/docker/stargazers","contributors_url":"https://api.github.com/repos/mountkin/docker/contributors","subscribers_url":"https://api.github.com/repos/mountkin/docker/subscribers","subscription_url":"https://api.github.com/repos/mountkin/docker/subscription","commits_url":"https://api.github.com/repos/mountkin/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/mountkin/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/mountkin/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/mountkin/docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/mountkin/docker/contents/{+path}","compare_url":"https://api.github.com/repos/mountkin/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mountkin/docker/merges","archive_url":"https://api.github.com/repos/mountkin/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mountkin/docker/downloads","issues_url":"https://api.github.com/repos/mountkin/docker/issues{/number}","pulls_url":"https://api.github.com/repos/mountkin/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/mountkin/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/mountkin/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mountkin/docker/labels{/name}","releases_url":"https://api.github.com/repos/mountkin/docker/releases{/id}","created_at":"2015-02-09T10:26:26Z","updated_at":"2015-03-10T03:07:29Z","pushed_at":"2015-05-07T07:45:34Z","git_url":"git://github.com/mountkin/docker.git","ssh_url":"git@github.com:mountkin/docker.git","clone_url":"https://github.com/mountkin/docker.git","svn_url":"https://github.com/mountkin/docker","homepage":"http://www.docker.com","size":53001,"stargazers_count":0,"watchers_count":0,"language":"Go","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":"docker:master","ref":"master","sha":"443437f5ea04da9d62bf3e05d7951f7d30e77d96","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-05-14T14:54:06Z","pushed_at":"2015-05-14T15:42:10Z","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":203736,"stargazers_count":21638,"watchers_count":21638,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":5069,"mirror_url":null,"open_issues_count":978,"forks":5069,"open_issues":978,"watchers":21638,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/12594"},"html":{"href":"https://github.com/docker/docker/pull/12594"},"issue":{"href":"https://api.github.com/repos/docker/docker/issues/12594"},"comments":{"href":"https://api.github.com/repos/docker/docker/issues/12594/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/docker/pulls/12594/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/docker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/docker/pulls/12594/commits"},"statuses":{"href":"https://api.github.com/repos/docker/docker/statuses/0ed6fbdf0cc7efc6c1a13c9b71d6b96617afd2ed"}}}}