-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename master branch to main #5188
Comments
Thanks for bringing this up! I'm a big +1 on making this change |
There is a practical consideration here. First of all, lets assume that the shields.io repo default branch would be renamed from master to main but our application will continue to assume that the default branch on most git(hub) repos is called master for now. That can move to another issue. For now, it is an accurate assumption. We frequently use To be clear, I'm not opposing this change, but there is a bunch of stuff that would need to happen first to do it in an orderly way. Other (less cumbersome) things that would need updating in order to make this change (do add more if you think of them):
|
Agreed. I don't think we can change that unless and until GitHub changes the name the platform selects for default branch. I believe another item we'll need to update is the message/badge added by the shields-deplyoment bot since I believe that's doing a comparison of |
I think this is a big and complicated issue, so I decided to write a small novel on the topic. Lets discuss that independently in #5215 |
Turns out this is actually going to happen the other way round |
AFAIK GitHub doesn't support renaming an existing branch, so I think we'd need to create a new Hopefully, no one is consuming assets directly from the source repo (i.e. consuming Perhaps we could pick and post a date for when the |
If they are doing this for some reason, and not specifying the branch, they will continue to get the default branch. |
Some additional useful reading on this:
Current recommendation from GH is:
|
Github have now released their tooling to make this easier |
Agreed. Shall we pick a target date for making the change? I feel like we've done enough forewarning about the intended change so as to not catch anyone off guard (still a bit unclear as to how branch changes were breaking certain direct-repo consumption patterns in other projects, but wanted to be mindful of it anyway) |
I think I'd rather frame it as "We need to do these things and then we can change it. Now is a good time to start doing them." rather than "We will change it on date X regardless of whether we have done the things or not.", but it is good to have a date to aim for :) Most of this falls into the category of "get busy with grep" but I think the tasks we need to get done to support this are going to include:
I've tried to be comprehensive there but please shout if you can see things I have not thought of. Lets try and make the list as comprehensive as possible before we start so we understand the full scope of the problem. Obviously that is quite cumbersome to co-ordinate. Redirects will paper over the cracks if we overlook or ignore some of that stuff (e.g: links in docs) but there are definitely important things in there we do need to manually deal with. Also if there are any of those categories of that Github pixies will take care of for us (e.g: branch protection rules), lets identify them so we know we don't have to do it/can check GH has worked the appropriate magic. I think we should probably aim to have a PR (or several smaller PRs) reviewed and ready to merge at the point we make the change and co-ordinate: merging those PRs, changing the actual branch name on the repo, and making the necessary updates to external services/repos as close together as possible to try and minimise the problems. |
Agreed, didn't intend to imply the latter, though also admit that in reading your list there were definitely a few things I hadn't considered so thanks for pulling all these together 👍 Do you think we need to create separate issues for addressing some of the specific or could we just check them off inline here? For example, there's a few of these line items that can be resolved independently and don't have to be done as part of a big bang, such as the changing the service tests and examples to use a different repository target/or a different non-master branch in our repo, we could (potentially) go ahead and plugin |
I think it is going to be simpler if there are fewer things that all need to happen all at the same time so if we can break this down and identify tasks that we can do ahead of time in a "forwards-compatible" way that will be helpful. |
I set up a couple of test repos Only the second one (the one where I renamed the branch rather than switching it) I got his notification: |
Were we still considering the alternative? I was under the impression that we were definitely going to leverage GitHub's rename feature. If we're going to preemptively change test targets/examples from the master branch in our own repo to something else, I was thinking we'd change the target altogether (e.g. from |
Until I tested it, I wasn't sure that switching the default branch to another existing one didn't trigger the same behaviour as renaming.
Yeah I think we do need to do that 👍 |
Gotcha, makes sense now |
There's a recent movement to replace "master" with a word that is descriptive while being absent the racist history of master & slave. This isn't a new idea, however it's gaining momentum on Twitter given the groundswell of action in the United States and globally after the police killing of George Floyd in Minneapolis two weeks ago. I stand with the protestors. 🖤
The language we use matters. Changing this for the Shields-managed repos is a minor inconvenience for us, and mostly a one-time thing, and seems well worth it.
I'd propose we rename the branch in Shields to
main
, update the open PRs to target that, and identify whatever else we have to update, like the deploy bot, deploy scripts, badges, etc.There's a tool here we could use for the PRs: https://github.com/ethomson/retarget_prs
(I think we should also review the places where we default to master in the badge code, and think about how to handle that, however let's discuss that in #4755 and open new issues as necessary.)
The text was updated successfully, but these errors were encountered: