-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tap-new: add option for branch name #8932
tap-new: add option for branch name #8932
Conversation
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.
Works for me. Matching the default GitHub behaviour for new repo branch names makes sense. Are there any docs we need to edit that are Homebrew-specific that need to take account of this change to specify --branch=master
?
@@ -142,6 +153,7 @@ def tap_new | |||
safe_system "git", "init" | |||
safe_system "git", "add", "--all" | |||
safe_system "git", "commit", "-m", "Create #{tap} tap" | |||
safe_system "git", "branch", "-m", branch |
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.
Maybe better specify -b
flag for git init
directly?
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 had it this way initially but tests failed. I think the -b
flag is a new feature that isn't available in the system versions of git
Good question, not sure. I'll take a look |
I think it's fine to just go with the default in that case and not mention it. |
Makes sense to me 👍🏻 |
Thanks again @Rylan12! |
brew style
with your changes locally?brew tests
with your changes locally?brew man
locally and committed any changes?Allow
tap-new
to accept a--branch
flag to specify a branch name for the new tap. Additionally, modify the CI workflows to be compatible with a custom branch name (another CI issue where the label name was missing quotes is fixed as well).Note: I've opted to make
main
be the default branch name here instead ofmaster
. GitHub repositories are now created with a default branch name ofmain
so I think it's fitting that we create new taps with a branch calledmain
by default. This also makes uploading the new tap repository to GitHub much easier (you can just copy and paste the necessary lines if you create a new repo from the web UI) and will allow all CI to work out of the box without needing to worry about branch names changing. I think it's a good idea to start using the branch namemain
where we can. The rest of the Homebrew project still usesmaster
as the default branch name, though, so I won't fight hard for this if keeping withmaster
is desired.