Skip to content
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

Open discussion: rename the default branch ? #160

Closed
jrfnl opened this issue Feb 10, 2022 · 15 comments · Fixed by #201
Closed

Open discussion: rename the default branch ? #160

jrfnl opened this issue Feb 10, 2022 · 15 comments · Fixed by #201

Comments

@jrfnl
Copy link
Member

jrfnl commented Feb 10, 2022

In a way a "bit late to the party", but should the default branch be renamed away from master ?

And if so, what would be the preferred new name ?

Some options:

  • A lot of repos have gone with main. For a "one branch" repo, that would be an obvious choice.
  • As an alternative, but that would also involve a different branching strategy, it could be considered to have a stable branch as a release branch and have a develop branch as the default PR branch. For a new release develop would then be merged into stable.

Opinions ?

@Potherca
Copy link
Member

I'm in favor of moving away from master.

I'd say, for now, lets just move to main ASAP (since we're making other soft-breaking changes to our dev environment anyway).

We can always move to something more elaborate when needed.

My 2️⃣🪙

@Potherca
Copy link
Member

Potherca commented Mar 5, 2022

Places that need editing for this rename:

## Tested against `master` branch?



[a code of conduct]: https://github.com/PHPCSStandards/composer-installer/blob/master/CODE_OF_CONDUCT.md

New releases (and any related tags) are always created from the `master` branch.

@Potherca
Copy link
Member

Potherca commented Mar 5, 2022

@jrfnl Do we want to make this change as well for the v1 release?

@jrfnl
Copy link
Member Author

jrfnl commented Mar 5, 2022

If we make this change, then, yes, the 1.0 release would be a good time to do so.

I suggest doing it just before the 1.0 release.
That way, if there are people who use dev-master, their workflow won't be broken without a notification (i.e. a mention in the release notes for the 1.0 release).

@paulshryock
Copy link

Another vote +1 for main branch just before the 1.0 release.

@Potherca
Copy link
Member

Potherca commented Jan 5, 2023

Resolved by #201

@danepowell
Copy link

That way, if there are people who use dev-master, their workflow won't be broken without a notification

Eh... consider me one of those people whose workflow was broken without notification. I thought you might be able to prevent breakage by adding a branch alias, but it seems like that's not possible: composer/composer#11301

@jrfnl
Copy link
Member Author

jrfnl commented Feb 6, 2023

@danepowell Out of curiosity: why were you using the master branch instead of a tagged release ?

@danepowell
Copy link

We needed #167 which was only in master at the time.

@jrfnl
Copy link
Member Author

jrfnl commented Feb 7, 2023

@danepowell Interesting. That bug was never reported by anyone, but clearly people (you) did run into it. Thanks for letting me know.

The good news is, of course, that the bug fix is included in the 1.0.0 release, so you should be able to switch back to versioned updates now.

@ntwb
Copy link
Contributor

ntwb commented Feb 7, 2023

Hey 👋🏼

A project I work on has also just been caught out by this change

One of the packages we use pushed a fix yesterday changing from dev-master to dev-main but they've not yet been able to tag and publish a new release yet...

Whilst we work to resolve these issues on our project, we'll create upstream updates for the packages we use and hoping they're maintained and can push new releases soon as this will be tricky for packages that are not so well maintained

A quick GitHub search shows 14 of the first 50 search results (3481 total results) use dev-master

Unsure of a workable solution, though a solution from Composer would be ideal, I've subscribed to composer/composer#11301 and will be interested in replies there...

Edit: Whilst we run our build script using the --no-dev flag to install packages as part of our deployment process Composer still requires that require-dev packages satisfy version requirements as per this message displayed:

  • "Running update with --no-dev does not mean require-dev is ignored, it just means the packages will not be installed. If dev requirements are blocking the update you have to resolve those problems."

@Potherca
Copy link
Member

Potherca commented Feb 9, 2023

@jrfnl Should we create a branch master from mainkeep the masterbranch which I accidentally creatyed from main for now until things are further resolved?

Apparently I just created one (I was fiddling around with the UI and apparent filling something in already creates the branch)

@jrfnl
Copy link
Member Author

jrfnl commented Feb 9, 2023

@Potherca I don't think so. Yes, the change is inconvenient for people, however:

  • People shouldn't be using dev-master (or dev-main) anyway.
  • Now the 1.0 release has been tagged, I expect we can go back to rapid releases for bug fixes (if any), which removes the need for anyone using dev-master/dev-main.
  • Now the 1.0 release has been tagged, people won't need to update the version constraints on every 0.x minor release anymore either (as those are treated as majors).

It's also a one-time only change (at least that's the intention) and we executed it in the most considerate way possible:

  • We has a long running open issue about the rename (this one).
  • We did the rename just before the release.
  • The rename was mentioned in the changelog of the release.

I'd recommend for people who choose to use dev- branches of repos to watch the repo or, at the very least, watch release notifications of those repos, but that's not our responsibility.

@danepowell
Copy link

The official suggestion from composer in composer/composer#11301 is that you should create a 1.x branch alias for main and projects should use that instead of dev-master or dev-main. That means not keeping a duplicate branch.

@ntwb
Copy link
Contributor

ntwb commented Feb 13, 2023

Should we ~create a branch master from main~keep the masterbranch which I accidentally creatyed from main for now until things are further resolved?

Apparently I just created one (I was fiddling around with the UI and apparent filling something in already creates the branch)

Oh, this could be why I've not encounted this previously.

GitHub redirects renamed branches, but only if they were renamed

https://github.blog/changelog/2020-07-17-links-to-deleted-branches-now-redirect-to-the-default-branch/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants