Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Proposal: Rename default branch to main #5141

Closed
colby-swandale opened this issue Dec 7, 2021 · 5 comments
Closed

Proposal: Rename default branch to main #5141

colby-swandale opened this issue Dec 7, 2021 · 5 comments

Comments

@colby-swandale
Copy link
Member

Abstract

I wish to propose renaming the default branch from master to main. The larger developer community has been moving away from non-inclusive terms such as master, slave, blacklist, whitelist, and I wish for RubyGems & RubyGems.org to do the same.

Other examples of open source projects renaming their default branch main:

This change is relatively minimal thanks to Github natively supporting renaming the default branch to main and will do most of the work for us automatically, such as adding automatic redirects & updating existing Pull Requests to point to main. But this will require some manual steps.

You can find more information at: https://github.com/github/renaming.

Steps Required

As mentioned, Github automates most of the needed steps to switch the default branch to main, but some steps still need to be performed manually by maintainers before & after the rename.

The following list covers steps that to my knowledge are required to do, but may not be indicative of covering everything.

Github Actions

Before renaming the default branch in Github, the Github Action Workflows will need to be amended to mirror the main and master branches. So that we can test pushing a commit to main, while developers continue to use master.

Update branch protection rules

We currently use branch protection to prevent merging Pull Requests that do not pass the status checks. This rule will need to be updated to use main after the default branch changes.

Local Migration

After the rename, developers will need to migrate their local development environment to main. This migration can be done by renaming the master branch to main and updating the remote to origin/main

$ git checkout master
$ git branch -m main
$ git branch -u origin/main

Remove/Rename references to master branch

Update Github actions to remove any branch filtering on the master branch and rename any references to master in the documentation & source code.

Renaming the default branch

The default branch can be renamed in Github, which is documented in doc.github.com

Questions

  • What impacts would this change cause downstream, such as Ruby-src, Truffleruby & JRuby?

    • How best do we communicate this change to maintainers?
  • Are any scripts/tooling affected by this proposed change?

  • Is the workflow in bundler-site affected by this proposed change?

@simi
Copy link
Member

simi commented Dec 7, 2021

IMHO we should just copy Ruby repo standards and discuss overall renaming of all Ruby repos (including std. libs - RubyGems) at https://bugs.ruby-lang.org/.

@hsbt
Copy link
Member

hsbt commented Dec 7, 2021

Ruby core followed Matz's opinion. I also agreed him.

@deivid-rodriguez
Copy link
Member

I'm in favor of doing this.

@deivid-rodriguez
Copy link
Member

What impacts would this change cause downstream, such as Ruby-src, Truffleruby & JRuby?

It does affect syncing with ruby-core because current scripts hardcode "master" as the default branch. They would need to be updated to infer the default branch for each repository instead of hardcoding it.

Are any scripts/tooling affected by this proposed change?

The scripts that generate the changelog will be affected, and also GitHub workflows.

Is the workflow in bundler-site affected by this proposed change?

Most likely yes.

@deivid-rodriguez
Copy link
Member

We currently use branch protection to prevent merging Pull Requests that do not pass the status checks. This rule will need to be updated to use main after the default branch changes.

I skimmed through https://github.com/github/renaming and apparently GitHub does this now automatically too 🎉.

@rubygems rubygems locked and limited conversation to collaborators Dec 7, 2021
@deivid-rodriguez deivid-rodriguez converted this issue into discussion #5145 Dec 7, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Projects
None yet
Development

No branches or pull requests

4 participants