{"action":"created","comment":{"url":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments/37137213","id":37137213,"diff_hunk":"@@ -19,14 +19,9 @@ def cleanup\n \n   def cleanup_logs\n     return unless HOMEBREW_LOGS.directory?\n-    prune = ARGV.value \"prune\"\n-    if prune\n-      time = Time.now - 60 * 60 * 24 * prune.to_i\n-    else\n-      time = Time.now - 60 * 60 * 24 * 7 * 2 # two weeks\n-    end\n+    prune = prune_flag 14 # two weeks unless overridden by argument","path":"Library/Homebrew/cmd/cleanup.rb","position":10,"original_position":10,"commit_id":"59d2a47b7ed8c05945eb367893c58c6b3fadf4f6","original_commit_id":"59d2a47b7ed8c05945eb367893c58c6b3fadf4f6","user":{"login":"mikemcquaid","id":125011,"avatar_url":"https://avatars.githubusercontent.com/u/125011?v=3","gravatar_id":"","url":"https://api.github.com/users/mikemcquaid","html_url":"https://github.com/mikemcquaid","followers_url":"https://api.github.com/users/mikemcquaid/followers","following_url":"https://api.github.com/users/mikemcquaid/following{/other_user}","gists_url":"https://api.github.com/users/mikemcquaid/gists{/gist_id}","starred_url":"https://api.github.com/users/mikemcquaid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikemcquaid/subscriptions","organizations_url":"https://api.github.com/users/mikemcquaid/orgs","repos_url":"https://api.github.com/users/mikemcquaid/repos","events_url":"https://api.github.com/users/mikemcquaid/events{/privacy}","received_events_url":"https://api.github.com/users/mikemcquaid/received_events","type":"User","site_admin":true},"body":"Actually, no, just handle the `prune_time` in the `cleanup?` method.","created_at":"2015-08-15T16:50:00Z","updated_at":"2015-08-15T16:50:00Z","html_url":"https://github.com/Homebrew/homebrew/pull/42970#discussion_r37137213","pull_request_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/42970","_links":{"self":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments/37137213"},"html":{"href":"https://github.com/Homebrew/homebrew/pull/42970#discussion_r37137213"},"pull_request":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/42970"}}},"pull_request":{"url":"https://api.github.com/repos/Homebrew/homebrew/pulls/42970","id":42519455,"html_url":"https://github.com/Homebrew/homebrew/pull/42970","diff_url":"https://github.com/Homebrew/homebrew/pull/42970.diff","patch_url":"https://github.com/Homebrew/homebrew/pull/42970.patch","issue_url":"https://api.github.com/repos/Homebrew/homebrew/issues/42970","number":42970,"state":"open","locked":false,"title":"cleanup: make --force less aggressive","user":{"login":"UniqMartin","id":11892150,"avatar_url":"https://avatars.githubusercontent.com/u/11892150?v=3","gravatar_id":"","url":"https://api.github.com/users/UniqMartin","html_url":"https://github.com/UniqMartin","followers_url":"https://api.github.com/users/UniqMartin/followers","following_url":"https://api.github.com/users/UniqMartin/following{/other_user}","gists_url":"https://api.github.com/users/UniqMartin/gists{/gist_id}","starred_url":"https://api.github.com/users/UniqMartin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UniqMartin/subscriptions","organizations_url":"https://api.github.com/users/UniqMartin/orgs","repos_url":"https://api.github.com/users/UniqMartin/repos","events_url":"https://api.github.com/users/UniqMartin/events{/privacy}","received_events_url":"https://api.github.com/users/UniqMartin/received_events","type":"User","site_admin":false},"body":"Change behavior for `brew cleanup` as follows:\r\n\r\n- If `--force` is supplied, remove only outdated keg-only packages.\r\n- If `--prune=<days>` is supplied, remove both logs and cached downloads older than the specified number of days. Use `--prune=all` to remove all logs and cached downloads irrespective of age.\r\n- By default, remove logs after 14 days and cached downloads never.\r\n\r\nAlso centralizes handling of `--prune`, thus removing duplicate logic.\r\n\r\nThis is motivated by commit 17eee232838d4639b25f863aa342b1dda61b81bc that made `--force` much more aggressive and made it override whatever was specified via `--prune`, completely removing all:\r\n\r\n- outdated keg-only packages\r\n- cached downloads irrespective of age\r\n- logs irrespective of age\r\n\r\nThis makes it impossible to remove outdated keg-only packages without also deleting all cached downloads, which is at least inconvenient for people with limited bandwidth wanting to rebuild packages later.\r\n\r\n**Additional notes:**\r\n\r\n- This addresses issue #42967.\r\n- The manual should probably be updated to reflect this change.\r\n- Now that `--prune` affects both logs and cached downloads, it might be beneficial to have both `--prune[-cache]` and `--prune-log` (not implemented here).","created_at":"2015-08-15T13:43:32Z","updated_at":"2015-08-15T16:50:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e88d083e2e55dd58c14da902867453cf355064d9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/42970/commits","review_comments_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/42970/comments","review_comment_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Homebrew/homebrew/issues/42970/comments","statuses_url":"https://api.github.com/repos/Homebrew/homebrew/statuses/59d2a47b7ed8c05945eb367893c58c6b3fadf4f6","head":{"label":"UniqMartin:softer-cleanup","ref":"softer-cleanup","sha":"59d2a47b7ed8c05945eb367893c58c6b3fadf4f6","user":{"login":"UniqMartin","id":11892150,"avatar_url":"https://avatars.githubusercontent.com/u/11892150?v=3","gravatar_id":"","url":"https://api.github.com/users/UniqMartin","html_url":"https://github.com/UniqMartin","followers_url":"https://api.github.com/users/UniqMartin/followers","following_url":"https://api.github.com/users/UniqMartin/following{/other_user}","gists_url":"https://api.github.com/users/UniqMartin/gists{/gist_id}","starred_url":"https://api.github.com/users/UniqMartin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UniqMartin/subscriptions","organizations_url":"https://api.github.com/users/UniqMartin/orgs","repos_url":"https://api.github.com/users/UniqMartin/repos","events_url":"https://api.github.com/users/UniqMartin/events{/privacy}","received_events_url":"https://api.github.com/users/UniqMartin/received_events","type":"User","site_admin":false},"repo":{"id":33837479,"name":"homebrew","full_name":"UniqMartin/homebrew","owner":{"login":"UniqMartin","id":11892150,"avatar_url":"https://avatars.githubusercontent.com/u/11892150?v=3","gravatar_id":"","url":"https://api.github.com/users/UniqMartin","html_url":"https://github.com/UniqMartin","followers_url":"https://api.github.com/users/UniqMartin/followers","following_url":"https://api.github.com/users/UniqMartin/following{/other_user}","gists_url":"https://api.github.com/users/UniqMartin/gists{/gist_id}","starred_url":"https://api.github.com/users/UniqMartin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/UniqMartin/subscriptions","organizations_url":"https://api.github.com/users/UniqMartin/orgs","repos_url":"https://api.github.com/users/UniqMartin/repos","events_url":"https://api.github.com/users/UniqMartin/events{/privacy}","received_events_url":"https://api.github.com/users/UniqMartin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/UniqMartin/homebrew","description":":package: Personal fork of “The missing package manager for OS X”.","fork":true,"url":"https://api.github.com/repos/UniqMartin/homebrew","forks_url":"https://api.github.com/repos/UniqMartin/homebrew/forks","keys_url":"https://api.github.com/repos/UniqMartin/homebrew/keys{/key_id}","collaborators_url":"https://api.github.com/repos/UniqMartin/homebrew/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/UniqMartin/homebrew/teams","hooks_url":"https://api.github.com/repos/UniqMartin/homebrew/hooks","issue_events_url":"https://api.github.com/repos/UniqMartin/homebrew/issues/events{/number}","events_url":"https://api.github.com/repos/UniqMartin/homebrew/events","assignees_url":"https://api.github.com/repos/UniqMartin/homebrew/assignees{/user}","branches_url":"https://api.github.com/repos/UniqMartin/homebrew/branches{/branch}","tags_url":"https://api.github.com/repos/UniqMartin/homebrew/tags","blobs_url":"https://api.github.com/repos/UniqMartin/homebrew/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/UniqMartin/homebrew/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/UniqMartin/homebrew/git/refs{/sha}","trees_url":"https://api.github.com/repos/UniqMartin/homebrew/git/trees{/sha}","statuses_url":"https://api.github.com/repos/UniqMartin/homebrew/statuses/{sha}","languages_url":"https://api.github.com/repos/UniqMartin/homebrew/languages","stargazers_url":"https://api.github.com/repos/UniqMartin/homebrew/stargazers","contributors_url":"https://api.github.com/repos/UniqMartin/homebrew/contributors","subscribers_url":"https://api.github.com/repos/UniqMartin/homebrew/subscribers","subscription_url":"https://api.github.com/repos/UniqMartin/homebrew/subscription","commits_url":"https://api.github.com/repos/UniqMartin/homebrew/commits{/sha}","git_commits_url":"https://api.github.com/repos/UniqMartin/homebrew/git/commits{/sha}","comments_url":"https://api.github.com/repos/UniqMartin/homebrew/comments{/number}","issue_comment_url":"https://api.github.com/repos/UniqMartin/homebrew/issues/comments{/number}","contents_url":"https://api.github.com/repos/UniqMartin/homebrew/contents/{+path}","compare_url":"https://api.github.com/repos/UniqMartin/homebrew/compare/{base}...{head}","merges_url":"https://api.github.com/repos/UniqMartin/homebrew/merges","archive_url":"https://api.github.com/repos/UniqMartin/homebrew/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/UniqMartin/homebrew/downloads","issues_url":"https://api.github.com/repos/UniqMartin/homebrew/issues{/number}","pulls_url":"https://api.github.com/repos/UniqMartin/homebrew/pulls{/number}","milestones_url":"https://api.github.com/repos/UniqMartin/homebrew/milestones{/number}","notifications_url":"https://api.github.com/repos/UniqMartin/homebrew/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/UniqMartin/homebrew/labels{/name}","releases_url":"https://api.github.com/repos/UniqMartin/homebrew/releases{/id}","created_at":"2015-04-12T23:04:38Z","updated_at":"2015-06-14T00:01:50Z","pushed_at":"2015-08-15T15:16:29Z","git_url":"git://github.com/UniqMartin/homebrew.git","ssh_url":"git@github.com:UniqMartin/homebrew.git","clone_url":"https://github.com/UniqMartin/homebrew.git","svn_url":"https://github.com/UniqMartin/homebrew","homepage":"http://brew.sh","size":50413,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":false,"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":"Homebrew:master","ref":"master","sha":"cc9c1ae714c4c9589568488f93762752cb5c06ec","user":{"login":"Homebrew","id":1503512,"avatar_url":"https://avatars.githubusercontent.com/u/1503512?v=3","gravatar_id":"","url":"https://api.github.com/users/Homebrew","html_url":"https://github.com/Homebrew","followers_url":"https://api.github.com/users/Homebrew/followers","following_url":"https://api.github.com/users/Homebrew/following{/other_user}","gists_url":"https://api.github.com/users/Homebrew/gists{/gist_id}","starred_url":"https://api.github.com/users/Homebrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Homebrew/subscriptions","organizations_url":"https://api.github.com/users/Homebrew/orgs","repos_url":"https://api.github.com/users/Homebrew/repos","events_url":"https://api.github.com/users/Homebrew/events{/privacy}","received_events_url":"https://api.github.com/users/Homebrew/received_events","type":"Organization","site_admin":false},"repo":{"id":206084,"name":"homebrew","full_name":"Homebrew/homebrew","owner":{"login":"Homebrew","id":1503512,"avatar_url":"https://avatars.githubusercontent.com/u/1503512?v=3","gravatar_id":"","url":"https://api.github.com/users/Homebrew","html_url":"https://github.com/Homebrew","followers_url":"https://api.github.com/users/Homebrew/followers","following_url":"https://api.github.com/users/Homebrew/following{/other_user}","gists_url":"https://api.github.com/users/Homebrew/gists{/gist_id}","starred_url":"https://api.github.com/users/Homebrew/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Homebrew/subscriptions","organizations_url":"https://api.github.com/users/Homebrew/orgs","repos_url":"https://api.github.com/users/Homebrew/repos","events_url":"https://api.github.com/users/Homebrew/events{/privacy}","received_events_url":"https://api.github.com/users/Homebrew/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Homebrew/homebrew","description":":beer: The missing package manager for OS X.","fork":false,"url":"https://api.github.com/repos/Homebrew/homebrew","forks_url":"https://api.github.com/repos/Homebrew/homebrew/forks","keys_url":"https://api.github.com/repos/Homebrew/homebrew/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Homebrew/homebrew/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Homebrew/homebrew/teams","hooks_url":"https://api.github.com/repos/Homebrew/homebrew/hooks","issue_events_url":"https://api.github.com/repos/Homebrew/homebrew/issues/events{/number}","events_url":"https://api.github.com/repos/Homebrew/homebrew/events","assignees_url":"https://api.github.com/repos/Homebrew/homebrew/assignees{/user}","branches_url":"https://api.github.com/repos/Homebrew/homebrew/branches{/branch}","tags_url":"https://api.github.com/repos/Homebrew/homebrew/tags","blobs_url":"https://api.github.com/repos/Homebrew/homebrew/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Homebrew/homebrew/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Homebrew/homebrew/git/refs{/sha}","trees_url":"https://api.github.com/repos/Homebrew/homebrew/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Homebrew/homebrew/statuses/{sha}","languages_url":"https://api.github.com/repos/Homebrew/homebrew/languages","stargazers_url":"https://api.github.com/repos/Homebrew/homebrew/stargazers","contributors_url":"https://api.github.com/repos/Homebrew/homebrew/contributors","subscribers_url":"https://api.github.com/repos/Homebrew/homebrew/subscribers","subscription_url":"https://api.github.com/repos/Homebrew/homebrew/subscription","commits_url":"https://api.github.com/repos/Homebrew/homebrew/commits{/sha}","git_commits_url":"https://api.github.com/repos/Homebrew/homebrew/git/commits{/sha}","comments_url":"https://api.github.com/repos/Homebrew/homebrew/comments{/number}","issue_comment_url":"https://api.github.com/repos/Homebrew/homebrew/issues/comments{/number}","contents_url":"https://api.github.com/repos/Homebrew/homebrew/contents/{+path}","compare_url":"https://api.github.com/repos/Homebrew/homebrew/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Homebrew/homebrew/merges","archive_url":"https://api.github.com/repos/Homebrew/homebrew/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Homebrew/homebrew/downloads","issues_url":"https://api.github.com/repos/Homebrew/homebrew/issues{/number}","pulls_url":"https://api.github.com/repos/Homebrew/homebrew/pulls{/number}","milestones_url":"https://api.github.com/repos/Homebrew/homebrew/milestones{/number}","notifications_url":"https://api.github.com/repos/Homebrew/homebrew/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Homebrew/homebrew/labels{/name}","releases_url":"https://api.github.com/repos/Homebrew/homebrew/releases{/id}","created_at":"2009-05-20T19:38:37Z","updated_at":"2015-08-15T16:45:46Z","pushed_at":"2015-08-15T16:43:42Z","git_url":"git://github.com/Homebrew/homebrew.git","ssh_url":"git@github.com:Homebrew/homebrew.git","clone_url":"https://github.com/Homebrew/homebrew.git","svn_url":"https://github.com/Homebrew/homebrew","homepage":"http://brew.sh","size":1583008,"stargazers_count":24645,"watchers_count":24645,"language":"Ruby","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":12380,"mirror_url":null,"open_issues_count":400,"forks":12380,"open_issues":400,"watchers":24645,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/42970"},"html":{"href":"https://github.com/Homebrew/homebrew/pull/42970"},"issue":{"href":"https://api.github.com/repos/Homebrew/homebrew/issues/42970"},"comments":{"href":"https://api.github.com/repos/Homebrew/homebrew/issues/42970/comments"},"review_comments":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/42970/comments"},"review_comment":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/42970/commits"},"statuses":{"href":"https://api.github.com/repos/Homebrew/homebrew/statuses/59d2a47b7ed8c05945eb367893c58c6b3fadf4f6"}}}}