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

Main Git branch renaming across WHATWG repositories #174

Closed
annevk opened this issue Jun 13, 2020 · 18 comments
Closed

Main Git branch renaming across WHATWG repositories #174

annevk opened this issue Jun 13, 2020 · 18 comments

Comments

@annevk
Copy link
Member

annevk commented Jun 13, 2020

As per https://mail.gnome.org/archives/desktop-devel-list/2019-May/msg00066.html the use of master in Git is clearly problematic.

I have some hope that GitHub will make this easier soonish (see https://twitter.com/natfriedman/status/1271253144442253312 though note that the replies are trash).

If that doesn't pan out, we can do it ourselves per the instructions in https://www.hanselman.com/blog/EasilyRenameYourGitDefaultBranchFromMasterToMain.aspx. main is also the name I'd suggest we use as there seems to be some tentative agreement around that.

Does anyone foresee any problems?

@dbaron
Copy link
Member

dbaron commented Jun 13, 2020

One GitHub issue I'm aware of is that if a repository is using GitHub Pages, that's only possible from a branch called master or gh-pages. So if any are, they'd probably need their primary branch renamed to gh-pages instead of main, at least for now. I saw a tweet about 6-12 hours ago saying they're working on fixing that, but I can't find it again.

I think another is that the step to update the default branch in the article you cite causes GitHub to give a big red warning box saying it might break certain things; I don't remember the contents of the warning but I think one of them was currently-outstanding pull requests. Another might be clones that people have. Given the convention about maintaining relatively long-lived PRs, that might be a bit problematic, and it's probably worth seeing how bad the effects will be with a test in another repository...

@zcorpan
Copy link
Member

zcorpan commented Jun 15, 2020

@foolip
Copy link
Member

foolip commented Jun 15, 2020

I tried renaming the default branch on a personal repository today to see what I'd run into:

  • Created and pushed the main branch
  • Pushed an additional commit to the main branch fixing CI setup
  • Changed the branch protection rules to apply to the main branch
  • Changed the default branch in GitHub's settings
    • This step automatically changed the base branch of the single open PR, a nice surprise
  • Removed the master branch

This all is not hard to do across all of our repos.

However, the final step of removing the master branch is going to break URLs, and there are probably quite many. I filed mheap/github-default-branch#6 about this, but don't know a good solution. The least bad option I can see is to add a final commit to the master branch with an ALL CAPS commit message and changing the README or another file that's unlikely to be linked, explaining the situation. The branch would need to be left around in perpetuity.

To solve this well, GitHub-side handling of branch renaming by redirecting would be needed.

Something I haven't explored is what happens to local checkouts. This too won't be entirely smooth unless there's GitHub-side handling, some kind of aliasing.

@domenic
Copy link
Member

domenic commented Jun 15, 2020

To solve this well, GitHub-side handling of branch renaming by redirecting would be needed.

I am hopeful this is in the works, given a vague public statements from the GitHub CEO on Twitter. So we should probably hold off to see what they announce.

@zcorpan
Copy link
Member

zcorpan commented Jun 17, 2020

https://github.com/chancancode/branch-rename might also be helpful.

I agree that waiting for GitHub is reasonable, but we can also inform them about the redirect feature request. Is Contact GitHub the right venue?

@foolip
Copy link
Member

foolip commented Jun 17, 2020

Yeah, use that form. I tried to email support@github.com a few days ago (about something else) and that doesn't work. Unlike what I've seen people claim, I've found GitHub's support to be pretty great, just not always fast.

@zcorpan
Copy link
Member

zcorpan commented Jun 17, 2020

Done, I've sent this:

See https://github.com/whatwg/meta/issues/174#issuecomment-644423829

> To solve this well, GitHub-side handling of branch renaming by redirecting would be needed.

Also see https://github.com/mheap/github-default-branch/issues/6

Can GitHub provide a way to redirect URLs when renaming branches?

@zcorpan
Copy link
Member

zcorpan commented Jun 17, 2020

Hello Simon,

Thanks for writing in! We are actively working alongside the Git project itself, as well as other version control vendors, on making three changes in GitHub: (1) we are changing the default branch name for new repos away from ‘master’ (2) we are making it easy for users to choose their own default branch name for all new repos created (3) we are releasing guidance and tools for users who may choose to rename their default branch in existing repos.

Our Pages team is also exploring ways to resolve the issue of the limited branch options in Pages sources.

I'm afraid I can't provide more concrete details yet, but thank you for writing in with this feedback. I am going to pass along your suggestion of redirecting URLs to our Product team, as that would certainly fall under number 2 above.

@annevk
Copy link
Member Author

annevk commented Jun 18, 2020

You might want to point out that it falls under 3.

@foolip
Copy link
Member

foolip commented Jul 14, 2020

https://github.com/google/mirror-branch-action by @jyasskin is something we could consider here, and fairly trivial to roll out using https://github.com/whatwg/spec-factory. Or we bake something into our deploy scripts to avoid using extra CI resources for this.

My only hesitation is that by maintaining the branch like this, "master" will keep showing up in git fetch and git log --decorate output indefinitely, so it'll still be there staring maintainers and contributors in the face every day.

Has anyone heard any updates on what GitHub might be planning here?

@travisleithead
Copy link
Member

No, I haven't heard anything yet.

@mheap
Copy link

mheap commented Jul 17, 2020

Good news! GitHub have just announced that any deleted branches now redirect to the default branch https://github.blog/changelog/2020-07-17-links-to-deleted-branches-now-redirect-to-the-default-branch/

@annevk
Copy link
Member Author

annevk commented Jul 19, 2020

Note that later in the year this will be a mostly automated process: https://github.com/github/renaming.

@foolip
Copy link
Member

foolip commented Aug 20, 2020

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

https://github.com/github/renaming#later-this-year-seamless-move-for-existing-repositories- looks like it will add some convenience, but I think most of the work for us would be in adapting our CI setup and updating references to master in lots of little places.

In other words, I don't think we necessarily need to wait for more support in https://github.com/github/renaming.

@annevk
Copy link
Member Author

annevk commented Jan 6, 2021

I looked into this again and per https://github.com/github/renaming#creating-a-seamless-move-for-existing-repositories- we should be able to roll this out soon. I suspect there will be some announcement in the coming weeks and when that comes we can start with the transition.

When that time comes we should grep for master as we do have code, e.g., https://github.com/whatwg/meta/blob/master/review.py, that relies on that. Some of that might continue to work as a result of GitHub making things more seamless, but we should still clean it up. Given that there are cross-repository dependencies we probably need to do it all in one sweep. Once GitHub makes the announcement I'm happy to start preparing PRs for the changes we need to make to code and such. And I guess I can work with @foolip (if he agrees) on doing the renaming and ensuring things work as expected afterward.

If anyone has other things we should consider now would be a good time to voice them.

annevk added a commit to whatwg/sg that referenced this issue Jan 13, 2021
annevk added a commit to whatwg/whatwg.org that referenced this issue Jan 13, 2021
annevk added a commit to whatwg/html that referenced this issue Jan 13, 2021
annevk added a commit to whatwg/spec-factory that referenced this issue Jan 13, 2021
annevk added a commit to whatwg/compat that referenced this issue Jan 13, 2021
annevk added a commit to whatwg/console that referenced this issue Jan 13, 2021
@annevk
Copy link
Member Author

annevk commented Jan 13, 2021

There's two kinds of changes we need to make. For all repositories we need to flip the branch name. We can also do this for archived repositories by unarchiving them, changing it, then archiving them again. (I have not listed those for now, but I'd like to do that as well once the main work is done.)

Here are the repositories in a list, I've already flipped some that I deemed safe:

  • books
  • compat
  • console
  • dom
  • encoding
  • fetch
  • figures
  • fullscreen
  • html
  • html-build
  • infra
  • loader
  • meta
  • mimesniff
  • misc-server
  • notifications
  • participant-data
  • participate.whatwg.org
  • platform.html5.org
  • quirks
  • sg
  • spec-factory
  • storage
  • streams
  • url
  • wattsi
  • web-history
  • whatwg.org
  • xhr

Then we need to make code changes to account for the branch name changes, let's track those in this list (thought to be complete):

There's also speced/bikeshed#1891, but I'm not sure if that's workable as those warnings are also for specifications outside the WHATWG presumably.

annevk added a commit to whatwg/html that referenced this issue Jan 13, 2021
annevk added a commit to whatwg/dom that referenced this issue Jan 15, 2021
annevk added a commit to whatwg/fetch that referenced this issue Jan 15, 2021
annevk added a commit to whatwg/xhr that referenced this issue Jan 15, 2021
annevk added a commit to whatwg/fetch that referenced this issue Jan 15, 2021
annevk added a commit to whatwg/xhr that referenced this issue Jan 15, 2021
annevk added a commit to whatwg/url that referenced this issue Jan 15, 2021
annevk added a commit to whatwg/storage that referenced this issue Jan 15, 2021
annevk added a commit to whatwg/url that referenced this issue Jan 15, 2021
annevk added a commit to whatwg/storage that referenced this issue Jan 15, 2021
annevk added a commit to whatwg/quirks that referenced this issue Jan 15, 2021
annevk added a commit to whatwg/encoding that referenced this issue Jan 15, 2021
annevk added a commit to whatwg/notifications that referenced this issue Jan 15, 2021
annevk added a commit to whatwg/notifications that referenced this issue Jan 15, 2021
annevk added a commit to whatwg/mimesniff that referenced this issue Jan 15, 2021
annevk added a commit to whatwg/infra that referenced this issue Jan 15, 2021
annevk added a commit to whatwg/mimesniff that referenced this issue Jan 15, 2021
annevk added a commit to whatwg/fullscreen that referenced this issue Jan 15, 2021
annevk added a commit to whatwg/fullscreen that referenced this issue Jan 15, 2021
annevk added a commit to whatwg/html-build that referenced this issue Jan 15, 2021
annevk added a commit to whatwg/html that referenced this issue Jan 15, 2021
Also correct a broken link. Not even w3.org URLs are that cool.

Helps with whatwg/meta#174.
annevk added a commit to whatwg/html-build that referenced this issue Jan 15, 2021
annevk added a commit to whatwg/html that referenced this issue Jan 15, 2021
Also correct a broken link. Not even w3.org URLs are that cool.

Helps with whatwg/meta#174.
annevk added a commit to whatwg/quirks that referenced this issue Jan 15, 2021
annevk added a commit to whatwg/infra that referenced this issue Jan 15, 2021
@annevk
Copy link
Member Author

annevk commented Jan 15, 2021

This is now done, including for archived repositories. To avoid the mistake I almost made for your own projects, use

grep -r master * .* --exclude-dir={..,.,.git}

or equivalent.

Pull requests will need to be rebased unfortunately due to the build configuration files including the default branch name. Let me know if you encounter problems.

The only weirdness I encountered thus far has been whatwg/build.whatwg.org#13, but it's unclear if that was related to the rename.

Thanks everyone!

@annevk annevk closed this as completed Jan 15, 2021
imhele added a commit to imhele/html that referenced this issue Feb 18, 2021
* Editorial: remove redundant "the"

* Meta: default branch rename

Also correct a broken link. Not even w3.org URLs are that cool.

Helps with whatwg/meta#174.

* Editorial: clean up calls to "parse a URL"

It actually takes a string, so calls should be clear about that.

* Review Draft Publication: January 2021

* Simplify <link>s

In particular, remove their activation behavior, stop them from matching
:link and :visited, and stop suggesting that they be focusable areas.

This also includes a slight expansion and rearrangement of the link
element's section to make it clearer what hyperlinks created by <link>
are meant for, contrasting them to <a> and <area> hyperlinks.

Closes whatwg#4831. Closes whatwg#2617. Helps with whatwg#5490.

* Meta: remove demos/offline/* (whatwg#6307)

These are no longer needed as of e4330d5.

* Meta: minor references cleanup

Use more HTTPS and drop obsolete HTML Differences reference.

* Editorial: anticlockwise → counterclockwise

We use en-US these days. Spotted in https://twitter.com/iso2022jp/status/1352601086519955456.

* Use :focus-visible in the UA stylesheet

See w3c/csswg-drafts#4278.

* Editorial: align with WebIDL and Infra

* Fix "update a style block" early return

The new version matches implementation reality and CSSWG resolution.

The algorithm was also inconsistent, as it looked at whether
the element was in a shadow tree or in the document tree, but it was
only specified to be re-run if the element becomes connected or
disconnected.

The CSSWG discussed this in
w3c/csswg-drafts#3096 (comment)
and http://wpt.live/shadow-dom/ShadowRoot-interface.html tests this.

This also matches closer the definition of <link rel="stylesheet">,
which does use connectedness (though it uses "browsing-context
connected", which is a bit different):
https://html.spec.whatwg.org/#link-type-stylesheet

* Modernize and refactor simple dialogs

This contains a small bug fix, in that confirm() and prompt() said
"return" in some cases instead of "return false" or "return null" as
appropriate.

Other notable changes, all editorial, are:

* Factoring out repeated "cannot show simple dialogs" steps, which will
  likely expand over time (see e.g. whatwg#6297).
* Separating out and explaining the no-argument overload of alert().
* Passing the document through to the "printing steps", instead of just
  having them talk about "this Window object".

* Meta: add definition markup for MessageEvent

* Remove <marquee> events

They are only supported by one engine (Gecko).

Closes whatwg#2957.

* Clarify when microtasks happen

* Ignore COEP on non-secure contexts

Fixes whatwg#6328.

* Editorial: update URL Standard integration

* Editorial: only invoke response's location URL once

Complements whatwg/fetch#1149.

* Track the incumbent settings and active script in Promise callbacks

Closes whatwg#5213.

* createImageBitmap(): stop clipping sourceRect to source's dimensions

It has been found in whatwg#6306 that this was an oversight at the time of its introduction. Current behavior goes against author expectations and no implementer has opposed the change to "no-clip".

Tests: web-platform-tests/wpt#27040.

Closes whatwg#6306.

* Remove CSP plugin-types blocking

With Flash not being supported anymore, the CSP directive plugin-types has lost its main reason for being and is being removed from the Content Security Policy specification: w3c/webappsec-csp#456.

This change removes references to the relevant algorithm from the Content Security Policy spec.

* Meta: set more dfn types

A follow-up to:

* whatwg#5694
* whatwg#5916

* Editorial: occuring → occurring

* Make all plugin-related APIs no-ops

Part of whatwg#6003.

* Disallow simple dialogs from different-origin domain iframes

Closes whatwg#5407.

* Revive @@iterator for PluginArray/MimeTypeArray/Plugin

@@iterator is implicitly installed by defining an indexed property getter. Since there is no other way to define it exclusively, this restores some methods back to being indexed getters.

This fixes an inadvertent observable behavior change in d4f07b8.

* Adjust web+ scheme security considerations to account for FTP removal

Also, network scheme is now reduced to HTTP(S) scheme.

Helps with whatwg#5375, but form submission issue remains.

See whatwg/fetch#1166 for context.

* Meta: export pause

Nobody but XMLHttpRequest take a dependency on this please. You have been warned.

Context: whatwg/xhr#311.

* Fix typo: ancestor → accessor

Fixes whatwg#6374.

Co-authored-by: Dominic Farolino <domfarolino@gmail.com>
Co-authored-by: Anne van Kesteren <annevk@annevk.nl>
Co-authored-by: Domenic Denicola <d@domenic.me>
Co-authored-by: Emilio Cobos Álvarez <emilio@crisal.io>
Co-authored-by: Momdo Nakamura <xmomdo@gmail.com>
Co-authored-by: Jake Archibald <jaffathecake@gmail.com>
Co-authored-by: Yutaka Hirano <yhirano@chromium.org>
Co-authored-by: Shu-yu Guo <syg@chromium.org>
Co-authored-by: Kaiido <tristan.fraipont@gmail.com>
Co-authored-by: Antonio Sartori <anton.sartori@gmail.com>
Co-authored-by: Michael[tm] Smith <mike@w3.org>
Co-authored-by: Ikko Ashimine <eltociear@gmail.com>
Co-authored-by: Carlos IL <carlosjoan91@gmail.com>
Co-authored-by: Kagami Sascha Rosylight <saschanaz@outlook.com>
Co-authored-by: Simon Pieters <zcorpan@gmail.com>
yutakahirano pushed a commit to yutakahirano/streams that referenced this issue Jun 3, 2021
@whatwg whatwg deleted a comment from Dfhjbcccc Jun 26, 2022
Bishwarupjee pushed a commit to Bishwarupjee/xhr that referenced this issue Jan 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

8 participants
@mheap @zcorpan @dbaron @foolip @domenic @annevk @travisleithead and others