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

Rename default branch from "master" to "main" #33864

Closed
trivikr opened this issue Jun 13, 2020 · 124 comments
Closed

Rename default branch from "master" to "main" #33864

trivikr opened this issue Jun 13, 2020 · 124 comments
Labels
discuss Issues opened for discussions and feedbacks. meta Issues and PRs related to the general management of the project. tsc-agenda Issues and PRs to discuss during the meetings of the TSC.

Comments

@trivikr
Copy link
Member

trivikr commented Jun 13, 2020

Is your feature request related to a problem? Please describe.
Lot of software developers are discussing on twitter to rename default branches for their projects from "master" to "main" or equivalent https://twitter.com/search?q=master%20branch&src=typed_query

The primary reason being master-slave an oppressive metaphor.

Describe the solution you'd like
Node.js core follows the trend to change the industry standard, and renames default branch from "master" to "main" or similar

Describe alternatives you've considered
Sticking with existing master branch name for the default

EDIT: Updated "renaming master to main" to "renaming default branch name from 'master' to 'main'"

@devsnek devsnek added discuss Issues opened for discussions and feedbacks. meta Issues and PRs related to the general management of the project. labels Jun 13, 2020
@devsnek
Copy link
Member

devsnek commented Jun 13, 2020

This is not a technically difficult task (https://www.hanselman.com/blog/EasilyRenameYourGitDefaultBranchFromMasterToMain.aspx) but it might break some things. I definitely think we should try to change it.

@ronag
Copy link
Member

ronag commented Jun 13, 2020

Does this mean we would have to change the cluster API (which includes master in its vocabulary) as well in a semver-major?

@Gallardo994

This comment has been minimized.

@ghost

This comment has been minimized.

@devsnek
Copy link
Member

devsnek commented Jun 13, 2020

@ronag i don't think that cluster was brought up in this thread, though it has been discussed on other occasions.

@ronag
Copy link
Member

ronag commented Jun 13, 2020

I'm -0 to the change itself. I don't think that changing it because it is "industry standard" is a valid argument, at least not yet. If we are changing it because we think it is a loaded/inappropriate word, then I think we should remove all occurrences to remain consistent with that decision.

@benjamingr
Copy link
Member

I don't feel like this is something people have actually complained about. When we've made these changes in the past (for example in child_worker.suicide) it was guided by someone acting in good faith feeling strongly about the terminology.

If someone from the project's base does feel strongly about it - I suggest we rename it, though master is the default git branch name so I would caution we pick our battles.

I vote we:

  • Don't change the name from master to something else currently.
  • Change it when a contributor/collaborator feels strongly enough about this.

Of course, if you @trivikr personally feel strongly about this then I support you :]

@trivikr
Copy link
Member Author

trivikr commented Jun 13, 2020

Of course, if you @trivikr personally feel strongly about this then I support you :]

I don't feel strongly against using master branch name. I proposed it as I plan to follow it in my personal projects and work projects, and wanted to ask Node.js community.

Should we add this to tsc-agenda?

though master is the default git branch name so I would caution we pick our battles.

Is there an equivalent ask in git repo?
If not, we should create one.

@benjamingr
Copy link
Member

Also, to all the people making the drive by comments: please keep discussion civil and remember Node.js has a code of conduct. If you can't be polite here you really don't have to comment. It's fine to either support or object to the proposed change (or any proposed change) as long as you are civil - we do not tolerate abuse towards the project and its members here.

To collaborators: kind reminder that you are allowed to ban users that make these sort of comments and to hide said comments - but please update the project (as explained there) with what actions you took so that any moderation actions taken are done in full transparency.

@benjamingr
Copy link
Member

Is there an equivalent ask in git repo?

I'm not sure where the git repo is - but I recommend trying the mailing list and asking there https://git-scm.com/community

I think "doing whatever git does and bringing the issue to their attention" is a viable strategy - but again, I don't feel particularly strongly about the use of "master" and if someone else does - sure.

Should we add this to tsc-agenda?

I'm not entirely sure why?

@trivikr
Copy link
Member Author

trivikr commented Jun 13, 2020

Should we add this to tsc-agenda?

I'm not entirely sure why?

To let tsc make a call on this request.

Other option would be to keep this issue open for a week or so, and see if it gathers more feedback or support.

@benjamingr
Copy link
Member

To let tsc make a call on this request.

As far as I understand it that's not how our governance works. Any collaborator may add the tsc-agenda label for an issue so it gets TSC eyes on it - but that should only be done if consensus seeking fails. It's an escape hatch for when we need to force a vote which is pretty rare. At least that is my understanding of the process.

So far everyone here seems to be pretty in sync (no one is opposed but no one is particularly in favor). We're not even in disagreement 😅

@trivikr
Copy link
Member Author

trivikr commented Jun 13, 2020

I'm not sure where the git repo is - but I recommend trying the mailing list and asking there git-scm.com/community

I've sent an email to Git Community mailing list, and will update here once they come up with a decision.

@ljharb
Copy link
Member

ljharb commented Jun 13, 2020

Bear in mind that URLs linking to master will not redirect to the new default branch name (and for repos where it matters, which isn't this one, github-pages only works on the default branch when it's named master). It may be worth waiting for Github to fix these discrepancies before making the switch.

(to be clear; i'm in favor of making the change, and "main" seems as good as anything else, but the disruption caused by Github's incomplete support for a non-master default branch are significant)

@jasnell
Copy link
Member

jasnell commented Jun 13, 2020

+1 to main but I do want to see what lead GitHub takes in making this easier

@MylesBorins
Copy link
Contributor

I personally feel very strongly that we should change this.

+1 to main

@AshCripps
Copy link
Member

I would be -1 untill a plan is drawn for the changes. This could cause a lot of issues with our build ci which would need to be accounted for.

@benjamingr
Copy link
Member

Ok, it looks like there are people in favor in the org who feel strongly that we should change this. So far no objections and everyone in the conversation is +0 -0 or +1.

Does anyone object to changing this (just the main branch name from master to main)?

It looks like it's not particularly hard technically (+ an update to the collaborator guide and policy). We probably need to address the links as well.

@ronag
Copy link
Member

ronag commented Jun 13, 2020

So far no objections and everyone in the conversation is +0 -0 or +1.

What about #33864 (comment)?

Also, I think GitHub might pick trunk instead of main. cli/cli#929...

Does anyone object to changing this (just the main branch name from master to main)?

I don't object... but I don't think it's a good idea to rush this...

@MylesBorins
Copy link
Contributor

Fwiw there is quite a lot of work for us to do in order to make sure we do this in a way that is not disruptive.

To @AshCripps point, we definitely need to do a large audit and preparation before moving forward.

I was putting together some notes yesterday outlining steps to take and what to consider before making a change like this

I'd like to suggest that we pause discussion until Monday and I can come back with a suggestion of what we should audit and steps to follow to do this in a way that would minimize disruption

@benjamingr
Copy link
Member

@ronag that message was posted after I started writing mine so I did not see it. Sorry for the (timing) confusion. Fwiw #33864 (comment) isn't a conceptual -1 it's a -1 until a plan is drawn for how we make the changes. I thought that not making the change quickly without discussing this or laying out how (clearly) is a given.

@nodejs nodejs deleted a comment Jun 13, 2020
@nodejs nodejs deleted a comment Jun 13, 2020
@trivikr trivikr changed the title Rename master branch to "main" or something similar Rename default branch from "master" to "main" or something similar Jun 13, 2020
@ARitz-Cracker
Copy link

Needlessly censoring words does nothing to resolve the social issues surrounding them. The reasoning behind this is the same used when changing the gun emoji to a squirt gun. But in the end, such efforts only take away words and symbols we can use to easily describe concepts, such as the hierarchical and control structures we work with every day. It's destructive at worst and pointless virtue signalling at best.

@ARitz-Cracker
Copy link

Anyway, -1 to this. Not worth the effort.

@ljharb
Copy link
Member

ljharb commented Feb 16, 2022

One thing to check is - in the prompt to do the renaming, it tells you how many PRs it will migrate. If that number doesn’t match the number of open ones, then those not included will be irrecoverably closed. This may be fine, maybe not, but it’s something to be cautious of. (it usually applies when the PR author has not checked “allow edits”, or, when they’ve deleted their fork). The person doing the migration won’t get notifications of the PR closures, but other watchers of them will.

@targos
Copy link
Member

targos commented Feb 16, 2022

image

@ljharb
Copy link
Member

ljharb commented Feb 16, 2022

That's not bad! Only 3 will end up being closed. Sadly there's no easy way to find those without looking through every open PR.

@bnb
Copy link
Contributor

bnb commented Feb 16, 2022

Maybe @bnb could you take a stab at this?

any specific ideas on what needs to be done here? Happy to help of course.

I think the big thing is that we'll all want to be ready to help out when something inevitably breaks because master is hardcoded. Looking through a very unsophisticated GitHub Search, we do have a lot of master in the codebase and some of them definitely seem to be referring to branches, including in python and Markdown. I think Markdown should be an easy fix in the future, but it's something that will need to be done.

@mcollina
Copy link
Member

any specific ideas on what needs to be done here? Happy to help of course.

No idea tbh :(. We really need a champion for this.

@mhdawson
Copy link
Member

I worked through most of the repositories so that we now have all but 6 out of over 100 moved over - see #33864 (comment) for the checklist.

The remaining ones are more complicated in that there are external dependencies. I know that @richardlau has volunteered to look at some of them.

I've not had any cycles lately to loop back and see where we have made process/try to unblock. @bnb that is where a champion who can take a look at the overall picture, do want's need for the remaining repos or find volunteers for the remaining 6 could really help to close it out.

@mhdawson
Copy link
Member

mhdawson commented Mar 10, 2022

These are the repos that still need a rename:

@mhdawson
Copy link
Member

Poked the issues for i18n, node-gyp, and unofficial-builds.

@targos
Copy link
Member

targos commented May 6, 2022

@ChALkeR
Copy link
Member

ChALkeR commented May 11, 2022

While https://github.blog/changelog/2022-05-05-block-creation-of-branches-that-have-matching-names/ doesn't restrict admins/owners, requiring signed commits should block accidental branch recreation, as not all of the commits in the history are signed. I checked that it works on https://github.com/nodejs/Gzemnid/settings/branch_protection_rules/25690377

Screenshot_20220511_163952

@targos
Copy link
Member

targos commented May 11, 2022

Nice workaround!

@mhdawson
Copy link
Member

mhdawson commented May 27, 2022

@nodejs/node FYI we are planning to rename the primary branch for nodejs/node to main on Wednesday June 15 ~ 10 ET. This will require that people do the following with respect to local clones. The info from GitHub:

Your members will have to manually update their local environments. We'll let them know when they visit the repository, or you can share the following commands.
git branch -m master main
git fetch origin
git branch -u origin/main main
git remote set-head origin -a

@richardlau
Copy link
Member

@nodejs/node FYI we are planning to rename the primary branch for nodejs/node to main on Wednesday June 15 ~ 10 ET. This will require that people do the following with respect to local clones. The info from GitHub:

Your members will have to manually update their local environments. We'll let them know when they visit the repository, or you can share the following commands.
git branch -m master main
git fetch origin
git branch -u origin/main main
git remote set-head origin -a

cc @nodejs/collaborators

@mcollina
Copy link
Member

wow, this has been a long time coming, congrats on the perseverance!

@mhdawson
Copy link
Member

@richardlau thanks for adding the at mention :)

@joyeecheung
Copy link
Member

Just noticed that we don't have a calendar event for the renaming (was trying to find the exact time in the calendar). It probably would be somewhat useful to create an event in the project calendar for this.

@joyeecheung
Copy link
Member

BTW for those who uses node-core-utils, you can use ncu-config to update your local config once the renaming happens:

$ ncu-config set branch main

@mhdawson
Copy link
Member

@joyeecheung added to the project calendar. For everybody it's this Wednesday June 15th.

@mhdawson
Copy link
Member

About to do the rename

@mhdawson
Copy link
Member

We went through and updated ~100 jobs, now testing a few key ones.

@mhdawson
Copy link
Member

Re-ran steps to check all repos in the node.js org above (#33864 (comment)) and they look good:

[midawson@midawson rename]$ node doit.js

  • .github:main
  • Gzemnid:main
  • Release:main
  • TSC:main
  • abi-stable-node:doc
  • admin:main
  • bot-love:main
  • branch-diff:main
  • build:main
  • build-toolchain-next:main
  • changelog-maker:main
  • ci-config-github-actions:main
  • ci-config-travis:main
  • citgm:main
  • cjs-module-lexer:main
  • code-and-learn:main
  • commit-stream:main
  • core-validate-commit:main
  • corepack:main
  • create-node-meeting-artifacts:main
  • devcontainer:main
  • diagnostics:main
  • docker-node:main
  • email:main
  • eslint-plugin-nodejs-internal:main
  • examples:main
  • full-icu-npm:main
  • full-icu-test:main
  • getting-started:main
  • github-bot:main
  • gyp-next:main
  • hardware:main
  • help:main
  • http-next:main
  • http-parser:main
  • i18n:main
  • icu4c-data-npm:main
  • js-native-api-test:main
  • llhttp:main
  • llnode:main
  • llparse:main
  • llparse-test-fixture:main
  • loaders:main
  • loaders-test:main
  • lts-schedule:main
  • make-node-meeting:main
  • meeting-picker:main
  • modules:main
  • nan:main
  • next-10:main
  • node:main
  • node-addon-api:main
  • node-addon-examples:main
  • node-api-headers:main
  • node-auto-test:main
  • node-code-ide-configs:main
  • node-core-test:main
  • node-core-utils:main
  • node-gyp:main
  • node-meeting-agenda:main
  • node-pr-labeler:main
  • node-review:main
  • node-v8:main
  • node-version-jenkins-plugin:main
  • node.js.org:gh-pages
  • nodejs-collection:main
  • nodejs-dist-indexer:main
  • nodejs-ko:main
  • nodejs-latest-linker:main
  • nodejs-nightly-builder:main
  • nodejs.dev:main
  • nodejs.org:main
  • official-images:main
  • package-maintenance:main
  • post-mortem:main
  • promises-debugging:main
  • readable-stream:main
  • release-keys:main
  • reliability:main
  • remark-preset-lint-node:main
  • repl:main
  • security-wg:main
  • snap:main
  • social-media-delegates:main
  • social-team:main
  • string_decoder:main
  • tap2junit:main
  • tooling:main
  • tweet:main
  • undici:main
  • unofficial-builds:main
  • uvwasi:main
  • version-management:main
  • web-server-frameworks:main
  • webidl-napi:main
    [midawson@midawson rename]$

@mhdawson
Copy link
Member

Good on the pkgjs branch as well

midawson@midawson rename]$ node doit.js

  • .github:main
  • action:main
  • action-import-blocklist:main
  • create:main
  • create-package-json:main
  • dependents:main
  • design:main
  • detect-node-support:main
  • meet:main
  • membership-updater:main
  • nv:main
  • parseargs:main
  • statusboard:main
  • support:main
  • support-separate-repo:main
  • triagebot:main
  • wiby:main
    [midawson@midawson rename]$

@MylesBorins
Copy link
Contributor

AMAZING!!!
Screen Shot 2022-06-15 at 12 14 01 PM

@bnb
Copy link
Contributor

bnb commented Jun 15, 2022

🎉 🎉 🎉 🎉 🎉 🎉 🎉 🎉

@trivikr
Copy link
Member Author

trivikr commented Jun 15, 2022

🙌 🙌 🙌

Can we unlock this issue?

@mhdawson can provide a public update and close it!

@aduh95
Copy link
Contributor

aduh95 commented Jun 15, 2022

I don’t think unlocking the issue is necessary at this point. If the branch rename is causing an issue, I’d recommend opening a new issue instead.
it feels good to click on the “Close as completed” button for this one, thanks to everyone who worked on making it happen 🚀

@aduh95 aduh95 closed this as completed Jun 15, 2022
@mhdawson
Copy link
Member

mhdawson commented Jun 15, 2022

We've completed running some tests and all looks ok at this point. We are not aware of any issues at this point.

This was a long an incremental effort (almost 2 years) and I'd like to thank @richardlau and @sxa who helped me do some of the tricker/more complicated repos. It was easier to do those as a group than it would have been for any one person on their own. Also thank to all of the other collaborators who supported in ways from finding a way to prevent accidental pushes of the old branch to quickly responding to issues suggesting the rename in repos across the nodejs org.

I'd also like to thank Red Hat management who early in the larger discussion on renaming primary repos across the GitHub ecosystem not only supported but asked teams to help open source communities make the change.

@sxa
Copy link
Member

sxa commented Jul 4, 2022

Added fix to node-stress-single-stress today which had a reference to the old name hiding in an advanced panel in the jenkins UI :-)

@benjamingr
Copy link
Member

Have to add that given the change size and my initial skepticism about it being a smooth transition - ±20 days later it has been a pretty smooth transition from a collaborator's PoV (at least mine) so props to whomever ensured that and made sure that this change could happen without interruptions.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
discuss Issues opened for discussions and feedbacks. meta Issues and PRs related to the general management of the project. tsc-agenda Issues and PRs to discuss during the meetings of the TSC.
Projects
None yet
Development

No branches or pull requests