Inclusive naming of default branches

There's been a lot of discussion in the last several weeks about removing references to slavery from tech. I've done some googling and checked the forums and a few Github issues page and there doesn't seem to be any discussion of this, aside from Rustlings who have already renamed the Master branch to Main.

I'm not shocked that Rust hasn't changed things yet, as I'm sure its a big job for such a huge project whose Master branch is probably referred to all over the place. But I am surprised that I haven't even been able to find discussion of it. So I thought I'd kick things off. I'm not an expert on Rust, or the Rust community, or racism frankly but I think this is important.

Talking points:

  1. Should established Rust projects rename their Master branches to Main (or Nightly or something else)? Lots of huge software projects are considering this change, and it would be a shame for Rust to be behind the ball given our aspirations about inclusivity.
  2. Could the default name for new projects in Cargo be changed from Master? There are already a few issues about how baked-in Master is in Cargo.
  3. Are there other terms in use in the Rust community that should be reconsidered? Blacklists and whitelists for example?

In a perfect world, Rust would be a leader in this. Thanks!

4 Likes

For what it's worth, I have seen some discussion of this on the Rust Discord. The forums don't tend to be where decisions like this get made.

I'd definitely be in favour of such a change (made the switch on my own repos when I saw the rustlings PR), but appreciate that there's probably a load of technical challenges doing so on such a large project.

With regards to other language to consider/what terminology to use instead, there's a good IETF draft recommendation that goes into this.

1 Like

Moderation note: Given the contentiousness of this topic, the moderators will be watching this topic closely. Expressing dissenting opinions is encouraged, but please do so productively.

For anyone involved in this discussion, please make an effort to assume good faith on the part of your fellow community members, especially when there is a disagreement.

7 Likes

I'd also like to note that this has been briefly discussed before: https://github.com/rust-lang/rust/issues/73385

It's likely that we might want to lock this thread as well, in favor of going through more targeted channels. In particular, it sounds like this probably needs to go through the RFC process or the compile team's major change process (at which point, dissenting opinions could be expressed). Discussing it in this forum is unlikely to produce the desired change.

5 Likes

For what it's worth I changed the time repository's branch to be called main last week.

I hope this is something one of the teams can decide on, instead of using the RFC process.

Hi!

So yeah, the core team has been discussing this issue a bit, and watching stuff evolve.

As Rust users are already changing their default branch names, the Cargo team has updated Cargo so that git dependencies in Cargo.toml default to the default branch as opposed to master.

There are basically two things we are looking at right now. We can move our repos over to using a differently named default branch, and we can make the git repo created by cargo new use a different name. If you think there are other things we should be doing here, feel free to contact us at core@rust-lang.org.

While changing the default branch for some of our repos is easy, a lot of infrastructure/tooling relies on rust-lang/rust using the master branch, so we’re being a bit cautious here: it would be good to see if the programming community settles on a particular choice of new default branch name, and if GitHub includes some tooling for making the transition easier.

We hope to keep people posted on this.

8 Likes

One thing to keep in mind with this is that it's currently just based on git init, which means it already respects whatever branch name someone has set. My cargo new creates a repo with a default branch named develop, and I wouldn't like it if it overwrote that to main or something after I intentionally set it up to use develop. On the other hand, if I hadn't made that active choice but still had a git template for installing default hooks or something, I would certainly appreciate cargo new choosing a different default branch name for me. This makes that a bit complicated.

14 Likes

@Manishearth Could the core team clarify when/where (or if) dissenting opinions should be heard?

2 Likes

That's a good point, thanks for bringing this up! cargo new was one thing I hadn't really looked deeply into yet (indeed, I pinged the cargo team to mention this just today), so this is good to know.

Not here, we're not monitoring this thread actively. We might end up opening an RFC or internals thread about this. We're not sure yet.

3 Likes

Great, I'm glad this is being discussed. Thanks for the update!

I just wanna bring in: not every Master is the master of a slave, you can be a master of a lot of things.
A master just means something ruling, a masters degree is about mastering a course, about being truly good at that class. A master branch is just a branch that is above all other branches.

14 Likes

Good point. The real problem is with the word "slave", which is unambiguous in its implications.

2 Likes

yes, to be clear I think removing things like master/slave node would might be something that we want to do, I can totally imagine someone feels attacked when such terms are used together.

Well said. I read a post the other day where someone pointed out that the Git master branch functions similarly to a master record when recording music:

a master recording is the official original recording of a song, sound or performance. Also referred to as “masters”, it is the source from which all the later copies are made.

This definition is from What is the Master Recording? - MixButton.

1 Like

Git's use of "master" is inherited from BitKeeper, which was definitely using it in the purpose of master/slave. Source: Re: Replacing "master" reference in git branch names (was Re: Proposal:

And if you don't trust that digging, here's the person who chose those defaults saying he wished he had chosen upstream/main rather than origin/master.

Here's two more mailing list responses from core git developers on the terminology:

The TL;DR is that while it may obviously be "master copy" and nonoffensive to you (especially if you're a white male, just in general (and so am I)), it's definitely not obvious to other people, and main is at least as good an option as master if you ignore legacy reasoning.

And nobody is suggesting to change a repository while there's still tooling with hardcoded master. They're suggesting fixing the hardcoded references to master, and then renaming existing branches. I believe GitHub is probably working on a feature to transparently redirect requests for renamed branches (such as master) to their new names, so that deep links into the master branch don't break, even. (Though you shouldn't be linking files on a branch anyway, you should be using the permalink which is via a commit hash instead, because that file could be edited, moved, or deleted, even if the branch name isn't changed.)


Plus, "master copy" isn't even a good analogy for git, which is a distributed version control system. The default branch is no more special than any other branch. There is no "master copy" according to git. All branches are equal.

Honestly, for rust-lang/rust, it'd be "more correct" to call the default branch nightly or development, because that's closer to what it is. If there is a "master copy" of the code, it'd be the published/tagged versions, not the development branch which is published as the nightlies and branched from to create release versions.

The only argument for sticking to master as the default branch is that it's always been that way, and that's the default name git gives to a branch if you git init and don't checkout a new branch, and that it's the default branch name used by GitHub. And GitHub is also moving away from (suggesting) using master as the default branch name.


Frankly: there are multiple substantiated arguments for changing the default default branch name from master to main, and for reconsidering the use of master as the default branch in projects that only use master because it is the default default.

I have yet to see a substantiated argument that master is a better default default branch name than main, other than "it's the current one".

You don't have to agree that master is a "bad" default to agree that main is a better default.

17 Likes

I notice that when people refer to the git branch that they want renaming they refer to it as the "default" branch. In the title of this thread, many times in the thread itself and other threads linked to from here. All over.

This may be a silly question then but...

Why not rename it to "default"?

Default branch refers to its placement in git/GitHub. It's the name of the first branch when you git init a repository and then commit without checking out a branch; it's the branch you're placed on when navigating to the GitHub page for the repository and not specifying a specific branch.

It's a good neutral way of describing the role of the name for the software, but not a great human-facing name for the branch.

The name (master, main, develop, nightly, next, unstable, etc.) is about the use of the branch. It tells you what's the branch is used for, not how the branch is used.

default is probably an ok default default branch name for git, if the intent is for everyone to change it to something that fits their development workflow better. But it's not a good name to actually use for a project's default branch.

main, on the other hand, is a good neutral default branch name, as it describes how why the default branch is the default, not just that it is the default.

1 Like

TL:DR The default branch should be named after a name that users know about from rustup. It should be called "stable".

You are right. People use git branches in all kind of interesting ways with all kind of names to server the purposes of this particular work flows. As such there is no name for that default branch that will suite everyone.

I can agree with that.

The humans in question are the users, potential users and even potential future developers of Rust. As such they will likely have started out by installing with rustup and had a read of the rustup documenation. Particularly how it manages Rust versions: Redirecting...

In that documentation we read about installing various stable releases, e.g:

$ rustup toolchain install 1.30.0 

Or nightly builds:

rustup toolchain install nightly-2018-08-01

Or whatever is the latest of various categories of development:

$ rustup toolchain install stable
$ rustup toolchain install beta
$ rustup toolchain install nightly

Nowhere in there do we read of "master", "main" or "default" versions (although a user can set any of the above as "default").

I suggest then that if the goal is a human facing name for branches in the Rust world it should be one that the Rust world already uses.

The default branch when I clone Rust from git should have the same name I get when I install from rustup. It should be "stable".