{"action":"created","comment":{"url":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments/51250243","id":51250243,"diff_hunk":"@@ -126,42 +120,58 @@ def pull\n         end\n       end\n \n+      orig_message = message = `git log HEAD^.. --format=%B`\n       if issue && !ARGV.include?(\"--clean\")\n         ohai \"Patch closes issue ##{issue}\"\n-        message = `git log HEAD^.. --format=%B`\n+        # If this is a pull request, append a close message.\n+        unless message.include? \"Closes ##{issue}.\"\n+          message += \"\\nCloses ##{issue}.\"\n+        end\n+      end\n \n-        if ARGV.include? \"--bump\"\n-          odie \"Can only bump one changed formula\" unless changed_formulae.length == 1\n-          formula = changed_formulae.first\n-          subject = \"#{formula.name} #{formula.version}\"\n+      if changed_formulae.empty?\n+        odie \"cannot bump: no changed formulae found after applying patch\" if do_bump\n+        is_bumpable = false\n+      end\n+      if is_bumpable && !ARGV.include?(\"--clean\")\n+        formula = changed_formulae.first\n+        new_versions = {\n+            stable: formula.stable.nil? ? nil : formula.stable.version.to_s,\n+            devel: formula.devel.nil? ? nil : formula.devel.version.to_s","path":"Library/Homebrew/cmd/pull.rb","position":150,"original_position":150,"commit_id":"5432af4e78b17df9e348b4de397528c15b0721c6","original_commit_id":"5432af4e78b17df9e348b4de397528c15b0721c6","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":"I don't think we use this hash syntax anywhere else and it's incompatible with Ruby 1.8 (though that is less of a concern in this particular command). This should be:\r\n\r\n```ruby\r\nnew_versions = {\r\n  :stable => formula.stable.nil? ? nil : formula.stable.version.to_s,\r\n  :devel => formula.devel.nil? ? nil : formula.devel.version.to_s,\r\n}\r\n```","created_at":"2016-01-29T11:17:23Z","updated_at":"2016-01-29T11:17:23Z","html_url":"https://github.com/Homebrew/homebrew/pull/48472#discussion_r51250243","pull_request_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/48472","_links":{"self":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments/51250243"},"html":{"href":"https://github.com/Homebrew/homebrew/pull/48472#discussion_r51250243"},"pull_request":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/48472"}}},"pull_request":{"url":"https://api.github.com/repos/Homebrew/homebrew/pulls/48472","id":57173379,"html_url":"https://github.com/Homebrew/homebrew/pull/48472","diff_url":"https://github.com/Homebrew/homebrew/pull/48472.diff","patch_url":"https://github.com/Homebrew/homebrew/pull/48472.patch","issue_url":"https://api.github.com/repos/Homebrew/homebrew/issues/48472","number":48472,"state":"open","locked":false,"title":"pull --bump: add auto-detection of devel bumps","user":{"login":"apjanke","id":2618447,"avatar_url":"https://avatars.githubusercontent.com/u/2618447?v=3","gravatar_id":"","url":"https://api.github.com/users/apjanke","html_url":"https://github.com/apjanke","followers_url":"https://api.github.com/users/apjanke/followers","following_url":"https://api.github.com/users/apjanke/following{/other_user}","gists_url":"https://api.github.com/users/apjanke/gists{/gist_id}","starred_url":"https://api.github.com/users/apjanke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apjanke/subscriptions","organizations_url":"https://api.github.com/users/apjanke/orgs","repos_url":"https://api.github.com/users/apjanke/repos","events_url":"https://api.github.com/users/apjanke/events{/privacy}","received_events_url":"https://api.github.com/users/apjanke/received_events","type":"User","site_admin":false},"body":"Not to step on @DomT4's fine work on this, but I had an idea for an alternate way of supporting `brew pull --bump` for `devel` bumps.\r\n\r\nHere's a version of `--bump` devel support that auto-detects which of the stable or devel versions, or both, have been changed, and constructs a message accordingly. No need to manually specify the `--devel` flag.\r\n\r\n###  Examples  ###\r\n\r\n(edited for conciseness)\r\n\r\n```\r\n$ brew pull --bump 48465\r\n...\r\nApplying: dummy upgrade acme stable\r\n==> Patch closes issue #48465\r\n==> New bump commit subject: acme 0.93\r\n\r\n$ brew pull --bump 48467\r\n...\r\nApplying: dummy upgrade acme devel version\r\n==> Patch closes issue #48467\r\n==> New bump commit subject: acme 0.95 (devel)\r\n\r\n$ brew pull --bump 48466\r\n...\r\nApplying: dummy upgrade acme both stable and devel\r\n==> Patch closes issue #48466\r\n==> New bump commit subject: acme 0.96, acme 0.99 (devel)\r\n\r\n```\r\n\r\nThe new helper methods have long-winded names to avoid collisions with other possible methods in `Homebrew`.\r\n\r\nCloses #48452\r\n\r\n### Testing  ###\r\n\r\nSome dummy PRs for testing this stuff against:\r\n\r\n#48465 – stable only\r\n#48467 – devel only\r\n#48466 – both stable and devel\r\n#48475 – remove the stable version\r\n#48488 – bump stable, remove devel\r\n#48478 – new formula \"whatever\" with only stable version\r\n#48580 – changes formula without bumping stable or devel versions","created_at":"2016-01-26T06:11:24Z","updated_at":"2016-01-29T11:17:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b675ba1f3a9b5af6fcdfceaa7b86159ee2948f61","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/48472/commits","review_comments_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/48472/comments","review_comment_url":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Homebrew/homebrew/issues/48472/comments","statuses_url":"https://api.github.com/repos/Homebrew/homebrew/statuses/5432af4e78b17df9e348b4de397528c15b0721c6","head":{"label":"apjanke:pull-bump-devel","ref":"pull-bump-devel","sha":"5432af4e78b17df9e348b4de397528c15b0721c6","user":{"login":"apjanke","id":2618447,"avatar_url":"https://avatars.githubusercontent.com/u/2618447?v=3","gravatar_id":"","url":"https://api.github.com/users/apjanke","html_url":"https://github.com/apjanke","followers_url":"https://api.github.com/users/apjanke/followers","following_url":"https://api.github.com/users/apjanke/following{/other_user}","gists_url":"https://api.github.com/users/apjanke/gists{/gist_id}","starred_url":"https://api.github.com/users/apjanke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apjanke/subscriptions","organizations_url":"https://api.github.com/users/apjanke/orgs","repos_url":"https://api.github.com/users/apjanke/repos","events_url":"https://api.github.com/users/apjanke/events{/privacy}","received_events_url":"https://api.github.com/users/apjanke/received_events","type":"User","site_admin":false},"repo":{"id":9083250,"name":"homebrew","full_name":"apjanke/homebrew","owner":{"login":"apjanke","id":2618447,"avatar_url":"https://avatars.githubusercontent.com/u/2618447?v=3","gravatar_id":"","url":"https://api.github.com/users/apjanke","html_url":"https://github.com/apjanke","followers_url":"https://api.github.com/users/apjanke/followers","following_url":"https://api.github.com/users/apjanke/following{/other_user}","gists_url":"https://api.github.com/users/apjanke/gists{/gist_id}","starred_url":"https://api.github.com/users/apjanke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apjanke/subscriptions","organizations_url":"https://api.github.com/users/apjanke/orgs","repos_url":"https://api.github.com/users/apjanke/repos","events_url":"https://api.github.com/users/apjanke/events{/privacy}","received_events_url":"https://api.github.com/users/apjanke/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/apjanke/homebrew","description":"The missing package manager for OS X.","fork":true,"url":"https://api.github.com/repos/apjanke/homebrew","forks_url":"https://api.github.com/repos/apjanke/homebrew/forks","keys_url":"https://api.github.com/repos/apjanke/homebrew/keys{/key_id}","collaborators_url":"https://api.github.com/repos/apjanke/homebrew/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/apjanke/homebrew/teams","hooks_url":"https://api.github.com/repos/apjanke/homebrew/hooks","issue_events_url":"https://api.github.com/repos/apjanke/homebrew/issues/events{/number}","events_url":"https://api.github.com/repos/apjanke/homebrew/events","assignees_url":"https://api.github.com/repos/apjanke/homebrew/assignees{/user}","branches_url":"https://api.github.com/repos/apjanke/homebrew/branches{/branch}","tags_url":"https://api.github.com/repos/apjanke/homebrew/tags","blobs_url":"https://api.github.com/repos/apjanke/homebrew/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/apjanke/homebrew/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/apjanke/homebrew/git/refs{/sha}","trees_url":"https://api.github.com/repos/apjanke/homebrew/git/trees{/sha}","statuses_url":"https://api.github.com/repos/apjanke/homebrew/statuses/{sha}","languages_url":"https://api.github.com/repos/apjanke/homebrew/languages","stargazers_url":"https://api.github.com/repos/apjanke/homebrew/stargazers","contributors_url":"https://api.github.com/repos/apjanke/homebrew/contributors","subscribers_url":"https://api.github.com/repos/apjanke/homebrew/subscribers","subscription_url":"https://api.github.com/repos/apjanke/homebrew/subscription","commits_url":"https://api.github.com/repos/apjanke/homebrew/commits{/sha}","git_commits_url":"https://api.github.com/repos/apjanke/homebrew/git/commits{/sha}","comments_url":"https://api.github.com/repos/apjanke/homebrew/comments{/number}","issue_comment_url":"https://api.github.com/repos/apjanke/homebrew/issues/comments{/number}","contents_url":"https://api.github.com/repos/apjanke/homebrew/contents/{+path}","compare_url":"https://api.github.com/repos/apjanke/homebrew/compare/{base}...{head}","merges_url":"https://api.github.com/repos/apjanke/homebrew/merges","archive_url":"https://api.github.com/repos/apjanke/homebrew/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/apjanke/homebrew/downloads","issues_url":"https://api.github.com/repos/apjanke/homebrew/issues{/number}","pulls_url":"https://api.github.com/repos/apjanke/homebrew/pulls{/number}","milestones_url":"https://api.github.com/repos/apjanke/homebrew/milestones{/number}","notifications_url":"https://api.github.com/repos/apjanke/homebrew/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/apjanke/homebrew/labels{/name}","releases_url":"https://api.github.com/repos/apjanke/homebrew/releases{/id}","deployments_url":"https://api.github.com/repos/apjanke/homebrew/deployments","created_at":"2013-03-28T18:09:07Z","updated_at":"2015-04-08T06:17:33Z","pushed_at":"2016-01-29T07:44:59Z","git_url":"git://github.com/apjanke/homebrew.git","ssh_url":"git@github.com:apjanke/homebrew.git","clone_url":"https://github.com/apjanke/homebrew.git","svn_url":"https://github.com/apjanke/homebrew","homepage":"http://brew.sh","size":69525,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"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":"67b879e327440d21c662e0ffa7f58b64908198cb","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}","deployments_url":"https://api.github.com/repos/Homebrew/homebrew/deployments","created_at":"2009-05-20T19:38:37Z","updated_at":"2016-01-29T10:09:29Z","pushed_at":"2016-01-29T11:15:55Z","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":1417047,"stargazers_count":28767,"watchers_count":28767,"language":"Ruby","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":14199,"mirror_url":null,"open_issues_count":466,"forks":14199,"open_issues":466,"watchers":28767,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/48472"},"html":{"href":"https://github.com/Homebrew/homebrew/pull/48472"},"issue":{"href":"https://api.github.com/repos/Homebrew/homebrew/issues/48472"},"comments":{"href":"https://api.github.com/repos/Homebrew/homebrew/issues/48472/comments"},"review_comments":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/48472/comments"},"review_comment":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Homebrew/homebrew/pulls/48472/commits"},"statuses":{"href":"https://api.github.com/repos/Homebrew/homebrew/statuses/5432af4e78b17df9e348b4de397528c15b0721c6"}}}}