RFC: Default to 'main' branch name for *NEW* repos in gitlab.gnome.org

Github will be switching to main naming scheme for the default branch of new projects, at some point this summer.

main is the most popular replacement for master that we’re seeing across GitHub. We like it because it’s short, it keeps your muscle memory intact, and it translates well across most languages. We’re using main for our newly-created repositories and for the repositories we’re moving now, like dependabot-core.

Gitlab is planning on doing the same for gitlab.com

With gitlab 13.2 we are able to change the default value of the branch name as well in gitlab.gnome.org. I am proposing we switch it to main following the other popular git hosting services.

Infrastructure issue

I think the consensus of the other discourse thread and the d-d-l thread is to move away from the master term for new things and investigate how feasible migration for existing repos is.

The only issue I can think of with changing the default is the weird limbo where some projects will use master and others main for the default branch, but given that Github and Gitlab have decided to go on with the same change its not something that we are going to avoid anyway.

11 Likes

flatpak and flatpak-builder will need fixing before this can happen though, as both of those currently fail to detect the default branch and will instead hardcode “master”. A fix similar to this one will be necessary:
https://gitlab.gnome.org/GNOME/jhbuild/-/commit/77192689d33d54a43289130c5d7edf85e89f9f3d

:+1:

We can definitely switch the default for new projects now, at zero cost; then we can migrate existing projects incrementally, since it has to be done semi-manually, and leave an opt out for projects that don’t want to change.

The reason why we need an incremental move is that some projects have CI scripts that reference the master branch as the default, and they would need time to adjust them, so it cannot be done with a GNOME-wide flag day.

:+1: Computers are surprisingly good at this search-and-replace thing; let’s do this!

1 Like

The original post says there was some kind of consensus in the linked thread. This is a friendly reminder that consensus was not to change the branch name, just in case there should be any doubt.

I wouldn’t call that “the consensus”.

The rough consensus was that changing the default branch of existing projects was made harder than necessary by Git, and required manual intervention. There was no opinion expressed on the default branch for new projects.

2 Likes

And even for the existing projects, that loud minority that didn’t want to lift a finger shouldn’t be considered consensus, especially as we never even started discussing how it would be implemented.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.