[go: nahoru, domu]

Page MenuHomePhabricator

Gerrit: default branch for new projects should be "main"
Open, Needs TriagePublic

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".Apr 8 2021, 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" 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.

@thcipriani since the migration to GitLab seems to be postponed (indefinitely?) can we reopen this ticket?

Per previous comment I'd prefer not to increase entropy, "but some projects ... while other projects ... and there's also ..." instructions on https://www.mediawiki.org/wiki/Gerrit/Tutorial#Update_the_main_development_branch , and wild guessing for new technical contributors. Thus I'd prefer to decline that the default branch for new projects only (emphasis mine) should be "main".

I could be on board with closing this ticket if there is an alternative ticket that outlines some concrete, pragmatic and likely-to-be-worked-upon path for moving away from master branches in our projects in the long term. I agree that new projects only is not the whole solution, but I imagine most solutions we come up with will involve some uncomfortable period where some repos have a main branch and some have a master and we're not sure which is which. We might be able to make that a bit less painful with something like a symbolic ref.