Skip to content
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

Use main for Homebrew branches #17296

Open
1 task done
MikeMcQuaid opened this issue May 14, 2024 · 6 comments
Open
1 task done

Use main for Homebrew branches #17296

MikeMcQuaid opened this issue May 14, 2024 · 6 comments
Labels
features New features help wanted We want help addressing this

Comments

@MikeMcQuaid
Copy link
Member

Verification

Provide a detailed description of the proposed feature

Homebrew should move to using the now GitHub and Git default of main for our branches.

We should start with less used taps e.g. Homebrew/homebrew-formula-analytics, move to more widely used taps Homebrew/homebrew-services, do so on Homebrew/homebrew-formula-core and Homebrew/homebrew-cask and end with Homebrew/brew.

It will be important to ensure that brew update, brew update-reset and brew test-bot all behave as expected.

What is the motivation for the feature?

Consistency across GitHub.

How will the feature be relevant to at least 90% of Homebrew users?

It's not.

What alternatives to the feature have been considered?

Leaving everything as master.

@MikeMcQuaid MikeMcQuaid added help wanted We want help addressing this features New features labels May 14, 2024
@gibfahn
Copy link
Contributor

gibfahn commented May 15, 2024

It will be important to ensure that brew update, brew update-reset and brew test-bot all behave as expected.

To confirm, "behave as expected" here means that e.g. brew update will seamlessly move the tap branch from master -> main right? if I recall correctly last time I tried this it instead errored and asked you to run brew tap --repair, which seems like something brew could handle for you.

https://github.com/homebrew/brew/blob/0a358b851875d8fe070396a7870a7f9b0dfc1634/Library/Homebrew/cmd/update-report.rb#L263-L269

@Bo98
Copy link
Member

Bo98 commented May 16, 2024

Ideally yeah. And if any fixes are required, it may mean having to keep a copy of master around indefinitely as an intermediate update step.

If it doesn't work well, a local symbolic-ref might be an alternative idea.

@MikeMcQuaid
Copy link
Member Author

To confirm, "behave as expected" here means that e.g. brew update will seamlessly move the tap branch from master -> main right?

Yes.

And if any fixes are required, it may mean having to keep a copy of master around indefinitely as an intermediate update step.

Ideally we don't want to do this but agreed it's worth doing if needed (at least on Homebrew/brew).

@unitof
Copy link
Contributor

unitof commented May 27, 2024

In the past, third party taps handled this with opoo but a silent method for renaming the main (or any) branch which doesn't require keeping the old branch around would be welcome.

@rrotter
Copy link
Contributor

rrotter commented Jul 2, 2024

Noting the "help wanted" tag, I'm interested in working on this, but I'm not clear what the action item is, or at least not what work there is that a non-maintainer could do (i.e. I clearly won't be renaming your repos on GitHub).

I tried renaming the main branch on a personal tap: brew update detects the rename, and recommends running brew tap --repair, which in turn works perfectly for correcting the refs in the tap.

Is the next step just adding logic to brew update to run brew tap --repair (or the equivalent ruby command) automatically when a branch rename is detected?

edit: I guess I should say that tap --repair works almost perfectly. After the rename there is still a ref left behind to remotes/origin/oldname, which git remote prune origin fixes.

@MikeMcQuaid
Copy link
Member Author

Is the next step just adding logic to brew update to run brew tap --repair (or the equivalent ruby command) automatically when a branch rename is detected?

Thanks for asking @rrotter! Yes, I think so. brew update should be able to handle these changes and run the relevant commands automatically for users with no intervention (although perhaps an ohai notifying them of the default branch change.

When you've verified this with some test personal taps: we can start moving some of the lesser used Homebrew official taps over.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
features New features help wanted We want help addressing this
Projects
None yet
Development

No branches or pull requests

5 participants