open-contracting / standard-maintenance-scripts

Scripts for maintaining all repositories, in particular the standard's documentation and extensions
https://open-contracting.github.io/standard-maintenance-scripts/
BSD 3-Clause "New" or "Revised" License
2 stars 2 forks source link

Rename "master" branches to "main" #158

Closed ColinMaudry closed 3 years ago

ColinMaudry commented 3 years ago

Github is pushing for the name "master" to retire, replacing it with "main". Since October 1st, unless configured otherwise, all new repositories have their main branch named "main".

What's OCP strategy gonna be?

ColinMaudry commented 3 years ago

More info here: https://github.com/github/renaming/

jpmckinney commented 3 years ago

We'll wait for GitHub to prepare the tools to make it easier: https://github.com/github/renaming/#later-this-year

jpmckinney commented 3 years ago

It looks like the changes will not be difficult, just long.

Going through each repository:


We serve extensions from GitHub at URLs that contain "master". According to https://github.blog/changelog/2020-07-17-links-to-deleted-branches-now-redirect-to-the-default-branch/, if we delete master and set main as default, these URLs will redirect. The initial estimate of the tasks to complete for open-contracting-extensions repositories was:

For the last item, having changed master to main for code repositories, there is a lot of code that assumes a default master branch for extensions. It will be too long and disruptive to change that. So, extensions and standard_extension_template will remain as master branch.


For profiles and standard_profile_template, we can change the default to latest:

jpmckinney commented 3 years ago

To do later, once consultants deliver the projects:

jpmckinney commented 3 years ago

Some false positives in comments, content:

ColinMaudry commented 3 years ago

Is there something to do on client side (typically, the cloned repos on my laptop)?

ColinMaudry commented 3 years ago

Also, are the extension repositories going to be impacted? https://github.com/open-contracting-extensions

60 repos!

jpmckinney commented 3 years ago

Also, are the extension repositories going to be impacted? https://github.com/open-contracting-extensions

No, there is too much logic that depends on extension repos using "master" as the live branch, so they will not be changed. I updated this comment: https://github.com/open-contracting/standard-maintenance-scripts/issues/158#issuecomment-729805445

jpmckinney commented 3 years ago

Is there something to do on client side (typically, the cloned repos on my laptop)?

For standard, infrastructure, public-private-partnerships, extensions and standard_extension_template, they haven't changed.

For other repositories, GitHub shares instructions if you visit the repo's page. I'll share them below.

For european-union, government-procurement-agreement and standard_profile_template, the default branch is now latest. You must do:

git branch -m master latest
git fetch origin
git branch -u origin/latest latest

For all other repositories (code repositories), you must do:

git branch -m master main
git fetch origin
git branch -u origin/main main