{"action":"closed","number":56,"pull_request":{"url":"https://api.github.com/repos/rancher/trash/pulls/56","id":91359272,"html_url":"https://github.com/rancher/trash/pull/56","diff_url":"https://github.com/rancher/trash/pull/56.diff","patch_url":"https://github.com/rancher/trash/pull/56.patch","issue_url":"https://api.github.com/repos/rancher/trash/issues/56","number":56,"state":"closed","locked":false,"title":"Retain original config file format","user":{"login":"karalabe","id":129561,"avatar_url":"https://avatars.githubusercontent.com/u/129561?v=3","gravatar_id":"","url":"https://api.github.com/users/karalabe","html_url":"https://github.com/karalabe","followers_url":"https://api.github.com/users/karalabe/followers","following_url":"https://api.github.com/users/karalabe/following{/other_user}","gists_url":"https://api.github.com/users/karalabe/gists{/gist_id}","starred_url":"https://api.github.com/users/karalabe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karalabe/subscriptions","organizations_url":"https://api.github.com/users/karalabe/orgs","repos_url":"https://api.github.com/users/karalabe/repos","events_url":"https://api.github.com/users/karalabe/events{/privacy}","received_events_url":"https://api.github.com/users/karalabe/received_events","type":"User","site_admin":false},"body":"Previously a `trash --update` overwrote any existing config file without retaining its original format (https://github.com/rancher/trash/issues/46). This had the unfortunate side effect that an original yaml config file was swapped out with a flat conf type. A proposal to fix this was done in https://github.com/rancher/trash/pull/50, but adding a new flag is a redundant operation since the code already knows what the original format was. This PR ensures that the original config file format (yaml or conf) is retained inside the `Conf` struct, allowing to serialize back to the same format on a dump.\n\nAnother bug was that `trash` recreated a new config structure from scratch on update, overwriting the old struct before the package metadata (version, external repo) could be extracted, losing all such information. A proposal was opened in https://github.com/rancher/trash/pull/51 to fix this, but it doesn't play nice with other internal/private fields in the `Conf` struct. This PR offers an alternative solution by not recreating the original config struct, just its `Imports` field. This was all private metadata is preserved, including the `importMap` containing the import meta fields.\n","created_at":"2016-10-28T10:37:24Z","updated_at":"2016-11-04T02:12:23Z","closed_at":"2016-11-04T02:12:23Z","merged_at":"2016-11-04T02:12:23Z","merge_commit_sha":"2f8cbee4416750eb605ecb57e222ff5720272f2f","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/rancher/trash/pulls/56/commits","review_comments_url":"https://api.github.com/repos/rancher/trash/pulls/56/comments","review_comment_url":"https://api.github.com/repos/rancher/trash/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rancher/trash/issues/56/comments","statuses_url":"https://api.github.com/repos/rancher/trash/statuses/eb72e6ae2ddb87aeb7e71038ed1deee80fd30b34","head":{"label":"karalabe:filetype-preservation","ref":"filetype-preservation","sha":"eb72e6ae2ddb87aeb7e71038ed1deee80fd30b34","user":{"login":"karalabe","id":129561,"avatar_url":"https://avatars.githubusercontent.com/u/129561?v=3","gravatar_id":"","url":"https://api.github.com/users/karalabe","html_url":"https://github.com/karalabe","followers_url":"https://api.github.com/users/karalabe/followers","following_url":"https://api.github.com/users/karalabe/following{/other_user}","gists_url":"https://api.github.com/users/karalabe/gists{/gist_id}","starred_url":"https://api.github.com/users/karalabe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karalabe/subscriptions","organizations_url":"https://api.github.com/users/karalabe/orgs","repos_url":"https://api.github.com/users/karalabe/repos","events_url":"https://api.github.com/users/karalabe/events{/privacy}","received_events_url":"https://api.github.com/users/karalabe/received_events","type":"User","site_admin":false},"repo":{"id":71794689,"name":"trash","full_name":"karalabe/trash","owner":{"login":"karalabe","id":129561,"avatar_url":"https://avatars.githubusercontent.com/u/129561?v=3","gravatar_id":"","url":"https://api.github.com/users/karalabe","html_url":"https://github.com/karalabe","followers_url":"https://api.github.com/users/karalabe/followers","following_url":"https://api.github.com/users/karalabe/following{/other_user}","gists_url":"https://api.github.com/users/karalabe/gists{/gist_id}","starred_url":"https://api.github.com/users/karalabe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karalabe/subscriptions","organizations_url":"https://api.github.com/users/karalabe/orgs","repos_url":"https://api.github.com/users/karalabe/repos","events_url":"https://api.github.com/users/karalabe/events{/privacy}","received_events_url":"https://api.github.com/users/karalabe/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/karalabe/trash","description":"Minimalistic Go vendored code manager","fork":true,"url":"https://api.github.com/repos/karalabe/trash","forks_url":"https://api.github.com/repos/karalabe/trash/forks","keys_url":"https://api.github.com/repos/karalabe/trash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/karalabe/trash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/karalabe/trash/teams","hooks_url":"https://api.github.com/repos/karalabe/trash/hooks","issue_events_url":"https://api.github.com/repos/karalabe/trash/issues/events{/number}","events_url":"https://api.github.com/repos/karalabe/trash/events","assignees_url":"https://api.github.com/repos/karalabe/trash/assignees{/user}","branches_url":"https://api.github.com/repos/karalabe/trash/branches{/branch}","tags_url":"https://api.github.com/repos/karalabe/trash/tags","blobs_url":"https://api.github.com/repos/karalabe/trash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/karalabe/trash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/karalabe/trash/git/refs{/sha}","trees_url":"https://api.github.com/repos/karalabe/trash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/karalabe/trash/statuses/{sha}","languages_url":"https://api.github.com/repos/karalabe/trash/languages","stargazers_url":"https://api.github.com/repos/karalabe/trash/stargazers","contributors_url":"https://api.github.com/repos/karalabe/trash/contributors","subscribers_url":"https://api.github.com/repos/karalabe/trash/subscribers","subscription_url":"https://api.github.com/repos/karalabe/trash/subscription","commits_url":"https://api.github.com/repos/karalabe/trash/commits{/sha}","git_commits_url":"https://api.github.com/repos/karalabe/trash/git/commits{/sha}","comments_url":"https://api.github.com/repos/karalabe/trash/comments{/number}","issue_comment_url":"https://api.github.com/repos/karalabe/trash/issues/comments{/number}","contents_url":"https://api.github.com/repos/karalabe/trash/contents/{+path}","compare_url":"https://api.github.com/repos/karalabe/trash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/karalabe/trash/merges","archive_url":"https://api.github.com/repos/karalabe/trash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/karalabe/trash/downloads","issues_url":"https://api.github.com/repos/karalabe/trash/issues{/number}","pulls_url":"https://api.github.com/repos/karalabe/trash/pulls{/number}","milestones_url":"https://api.github.com/repos/karalabe/trash/milestones{/number}","notifications_url":"https://api.github.com/repos/karalabe/trash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/karalabe/trash/labels{/name}","releases_url":"https://api.github.com/repos/karalabe/trash/releases{/id}","deployments_url":"https://api.github.com/repos/karalabe/trash/deployments","created_at":"2016-10-24T13:59:00Z","updated_at":"2016-10-24T13:59:02Z","pushed_at":"2016-10-28T13:02:54Z","git_url":"git://github.com/karalabe/trash.git","ssh_url":"git@github.com:karalabe/trash.git","clone_url":"https://github.com/karalabe/trash.git","svn_url":"https://github.com/karalabe/trash","homepage":"","size":1015,"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":"fork"}},"base":{"label":"rancher:master","ref":"master","sha":"2634e3b8f4e86ade18b6a6d190b6f41e6a85cf0d","user":{"login":"rancher","id":9343010,"avatar_url":"https://avatars.githubusercontent.com/u/9343010?v=3","gravatar_id":"","url":"https://api.github.com/users/rancher","html_url":"https://github.com/rancher","followers_url":"https://api.github.com/users/rancher/followers","following_url":"https://api.github.com/users/rancher/following{/other_user}","gists_url":"https://api.github.com/users/rancher/gists{/gist_id}","starred_url":"https://api.github.com/users/rancher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rancher/subscriptions","organizations_url":"https://api.github.com/users/rancher/orgs","repos_url":"https://api.github.com/users/rancher/repos","events_url":"https://api.github.com/users/rancher/events{/privacy}","received_events_url":"https://api.github.com/users/rancher/received_events","type":"Organization","site_admin":false},"repo":{"id":48107890,"name":"trash","full_name":"rancher/trash","owner":{"login":"rancher","id":9343010,"avatar_url":"https://avatars.githubusercontent.com/u/9343010?v=3","gravatar_id":"","url":"https://api.github.com/users/rancher","html_url":"https://github.com/rancher","followers_url":"https://api.github.com/users/rancher/followers","following_url":"https://api.github.com/users/rancher/following{/other_user}","gists_url":"https://api.github.com/users/rancher/gists{/gist_id}","starred_url":"https://api.github.com/users/rancher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rancher/subscriptions","organizations_url":"https://api.github.com/users/rancher/orgs","repos_url":"https://api.github.com/users/rancher/repos","events_url":"https://api.github.com/users/rancher/events{/privacy}","received_events_url":"https://api.github.com/users/rancher/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/rancher/trash","description":"Minimalistic Go vendored code manager","fork":false,"url":"https://api.github.com/repos/rancher/trash","forks_url":"https://api.github.com/repos/rancher/trash/forks","keys_url":"https://api.github.com/repos/rancher/trash/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rancher/trash/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rancher/trash/teams","hooks_url":"https://api.github.com/repos/rancher/trash/hooks","issue_events_url":"https://api.github.com/repos/rancher/trash/issues/events{/number}","events_url":"https://api.github.com/repos/rancher/trash/events","assignees_url":"https://api.github.com/repos/rancher/trash/assignees{/user}","branches_url":"https://api.github.com/repos/rancher/trash/branches{/branch}","tags_url":"https://api.github.com/repos/rancher/trash/tags","blobs_url":"https://api.github.com/repos/rancher/trash/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rancher/trash/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rancher/trash/git/refs{/sha}","trees_url":"https://api.github.com/repos/rancher/trash/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rancher/trash/statuses/{sha}","languages_url":"https://api.github.com/repos/rancher/trash/languages","stargazers_url":"https://api.github.com/repos/rancher/trash/stargazers","contributors_url":"https://api.github.com/repos/rancher/trash/contributors","subscribers_url":"https://api.github.com/repos/rancher/trash/subscribers","subscription_url":"https://api.github.com/repos/rancher/trash/subscription","commits_url":"https://api.github.com/repos/rancher/trash/commits{/sha}","git_commits_url":"https://api.github.com/repos/rancher/trash/git/commits{/sha}","comments_url":"https://api.github.com/repos/rancher/trash/comments{/number}","issue_comment_url":"https://api.github.com/repos/rancher/trash/issues/comments{/number}","contents_url":"https://api.github.com/repos/rancher/trash/contents/{+path}","compare_url":"https://api.github.com/repos/rancher/trash/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rancher/trash/merges","archive_url":"https://api.github.com/repos/rancher/trash/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rancher/trash/downloads","issues_url":"https://api.github.com/repos/rancher/trash/issues{/number}","pulls_url":"https://api.github.com/repos/rancher/trash/pulls{/number}","milestones_url":"https://api.github.com/repos/rancher/trash/milestones{/number}","notifications_url":"https://api.github.com/repos/rancher/trash/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rancher/trash/labels{/name}","releases_url":"https://api.github.com/repos/rancher/trash/releases{/id}","deployments_url":"https://api.github.com/repos/rancher/trash/deployments","created_at":"2015-12-16T12:02:32Z","updated_at":"2016-11-03T23:48:11Z","pushed_at":"2016-11-04T02:12:23Z","git_url":"git://github.com/rancher/trash.git","ssh_url":"git@github.com:rancher/trash.git","clone_url":"https://github.com/rancher/trash.git","svn_url":"https://github.com/rancher/trash","homepage":"","size":1029,"stargazers_count":127,"watchers_count":127,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":20,"mirror_url":null,"open_issues_count":10,"forks":20,"open_issues":10,"watchers":127,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rancher/trash/pulls/56"},"html":{"href":"https://github.com/rancher/trash/pull/56"},"issue":{"href":"https://api.github.com/repos/rancher/trash/issues/56"},"comments":{"href":"https://api.github.com/repos/rancher/trash/issues/56/comments"},"review_comments":{"href":"https://api.github.com/repos/rancher/trash/pulls/56/comments"},"review_comment":{"href":"https://api.github.com/repos/rancher/trash/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rancher/trash/pulls/56/commits"},"statuses":{"href":"https://api.github.com/repos/rancher/trash/statuses/eb72e6ae2ddb87aeb7e71038ed1deee80fd30b34"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"imikushin","id":931932,"avatar_url":"https://avatars.githubusercontent.com/u/931932?v=3","gravatar_id":"","url":"https://api.github.com/users/imikushin","html_url":"https://github.com/imikushin","followers_url":"https://api.github.com/users/imikushin/followers","following_url":"https://api.github.com/users/imikushin/following{/other_user}","gists_url":"https://api.github.com/users/imikushin/gists{/gist_id}","starred_url":"https://api.github.com/users/imikushin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/imikushin/subscriptions","organizations_url":"https://api.github.com/users/imikushin/orgs","repos_url":"https://api.github.com/users/imikushin/repos","events_url":"https://api.github.com/users/imikushin/events{/privacy}","received_events_url":"https://api.github.com/users/imikushin/received_events","type":"User","site_admin":false},"comments":1,"review_comments":0,"commits":1,"additions":12,"deletions":4,"changed_files":2}}
{"actor":{"display_login":"imikushin"}}