-
-
Notifications
You must be signed in to change notification settings - Fork 11.2k
bump-formula-pr: add new command. #49848
Conversation
safe_system "hub", "fork", "--no-remote" | ||
quiet_system "hub", "fork" | ||
/fatal: remote (.+) already exists./ =~ Utils.popen_read("hub fork 2>&1") | ||
remote = $1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remote = Utils.popen_read("hub", "fork")[/fatal: remote (.+) already exists./, 1]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
What happens if my origin remote is pointed to my own fork and the upstream is pointed to the Homebrew? Sorry, but this is my personal setup. |
resource_specs = formula_spec.specs | ||
old_tag = resource_specs[:tag] | ||
old_revision = resource_specs[:revision] | ||
s.gsub!(old_tag, new_tag) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the tag is usually version string. This replacement may happen in the wrong places, e.g resources.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestions for a better replacement?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s.gsub!("\"#{old_tag}\"", "\"#{new_tag}\"")
I guess you can play around with |
@MikeMcQuaid Actually, getting the username should be straightforward since it's required for hub:
|
Add a new developer command (i.e. requires `HOMEBREW_DEVELOPER` set in your environment) to bump the version of a formula and create a new pull request with the new version. Closes Homebrew#49848. Signed-off-by: ilovezfs <[email protected]>
|
||
formula.path.parent.cd do | ||
branch = "#{formula.name}-#{new_formula_version}" | ||
safe_system "git", "checkout", "-b", branch, "master" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you may want origin/master
(or upstream/master
if you go with @xu-cheng's naming convention) not master
to avoid what just happened to me (as a result of having done brew pull 49848
first) :

When the command succeeds, it probably should put you back on your original branch as well. Also, I think it would be nice if the command would guess the url based on a basic version string replacement if a full URL isn't provided, and also automatically compute the checksum when the download is successful (and possibly also that the archive can be unpacked just to verify it's sane). As noted here #49918 (comment), the command needs to delete any |
@MikeMcQuaid Having second thoughts about this one? |
@ilovezfs Nope, just been busy! |
@MikeMcQuaid Ah, ok! I'd suggest at least integrating the master -> origin/master change so that this can be used via brew pull without replicating my blunder above. |
Updated (on |
Add a new developer command (i.e. requires `HOMEBREW_DEVELOPER` set in your environment) to bump the version of a formula and create a new pull request with the new version. Closes #49848.
Add a new developer command (i.e. requires `HOMEBREW_DEVELOPER` set in your environment) to bump the version of a formula and create a new pull request with the new version. Closes Homebrew/legacy-homebrew#49848.
Is the usage documented somewhere? (For |
just saw the comments in the file diff... ignore my previous post |
Add a new developer command (i.e. requires
HOMEBREW_DEVELOPER
set in your environment) to bump the version of a formula and create a new pull request with the new version.CC @mdiep @mislav @xu-cheng