Page MenuHomePhabricator

Gerrit: default branch for new projects should be "main"
Closed, DeclinedPublic

Description

Recently there was a change merged to Gerrit to allow us to set an instance-wide default branch name: https://gerrit-review.googlesource.com/c/gerrit/+/299801

Once we have updated Gerrit to a sufficiently recent version, we should rename our default branch.

Event Timeline

thcipriani renamed this task from Gerrit: default branch for new projects should be "main' to Gerrit: default branch for new projects should be "main".Thu, Apr 8, 1:11 AM
thcipriani changed the task status from Open to Stalled.
thcipriani updated the task description. (Show Details)

Marking as stalled at the moment as we need a new Gerrit release before this is possible.

I'd like to note that this will complicate patch contributions further.
See the commands including the term master on https://www.mediawiki.org/wiki/Gerrit/Tutorial (which already has the line "However, note that a few repositories use different terms (for example, the operations/puppet repository has a production instead of a master branch).") and many other pages.

Ideally I'd prefer to rename that branch in all repos (and docs) at once (which breaks things and requires way more work and coordination, obviously). :-/

Agreed with @Aklapper - plenty of tooling relies on the master branch. We should rename everything at the same time. Having some repos with "main" is already starting to cause problems (e.g. T273237: LibUp needs to handle "main" branches nicely).

Ideally I'd prefer to rename that branch in all repos (and docs) at once (which breaks things and requires way more work and coordination, obviously). :-/

This is reasonable. I've no particular objection to changing Gerrit's default for new projects, but noting here explicitly that we plan to transition WMF repos overall to a default of "main" as we migrate to GitLab. The migration is already going to require plenty of updates to tooling and documentation as we go, so hopefully we can consolidate some of the pain of dealing with both name changes and new remotes.

Noting here: T281593: Rename mainline Git branch from "master" to "main" on all WMF-hosted repositories during GitLab migration

Declining this task in favor of T281593: Rename mainline Git branch from "master" to "main" on all WMF-hosted repositories during GitLab migration

Not that the two are mutually exclusive, but this change needs to be carefully rolled out to avoid unnecessary breakage. Doing this transition in a structured way alongside already planned breakage seems like a reasonable path forward.

Thanks for the comments all!

So...what about repositories that are already using "main"? This is becoming more common when repos are being imported from GitHub where it's the new default. https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/services/similar-users/ for example.