Skip to content

add main to the master branch regex in the default configuration #2367

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

Merged

Conversation

thetimbecker
Copy link
Contributor

@thetimbecker thetimbecker commented Jul 22, 2020

As many more organizations (including GitHub) and repositories are moving towards naming their default branch main instead of master, it would be useful to include this naming in the default configuration.

Description

Change the default regex for master branches from ^master$ to ^master|main$.

Related Issue

Fixes #2366.

Motivation and Context

Our organization is making this change and many of our repos use GitVersion. We could make custom configurations for all these repositories, but that is yet another configuration file to maintain and distribute. As this is a movement that is gaining popularity across the board, it would be useful to have this baked into GitVersion and not require a custom configuration.

main seems to be the general consensus from the community as the preferred alternative to master. It also seems to be the preferred name of the developer who chose the original names.

How Has This Been Tested?

I attempted to test this locally but was unable to figure out how to build the project. I attempted to build it in a docker image but my changes were not there. I would appreciate help on this.
I wasn't able to package it locally still, but I was able to get the project working and ran the tests that were breaking in GitHub. Much easier than making a commit to test.

Screenshots (if appropriate):

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@asbjornu
Copy link
Member

Seems like this change broke a few tests, @thetimbecker. Could you please look into why?

@thetimbecker thetimbecker force-pushed the feature/add-main-to-master-regex branch from 7365bce to 9f5494c Compare July 22, 2020 18:30
@thetimbecker
Copy link
Contributor Author

@asbjornu fixed

@asbjornu asbjornu merged commit 507686e into GitTools:master Jul 22, 2020
@asbjornu
Copy link
Member

This is great, thanks @thetimbecker! 🙏

arturcic pushed a commit that referenced this pull request Jul 22, 2020
Merge pull request #2367 from TheTimBecker/feature/add-main-to-master-regex

add main to the master branch regex in the default configuration
@arturcic arturcic added this to the 5.5.0 milestone Sep 14, 2020
@arturcic arturcic removed this from the 5.5.0 milestone Sep 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Improvement] Add "main" to master branch regex
3 participants