Closed TimidRobot closed 2 years ago
cc-archive
GitHub OrganizationAll 1 private repositories are using main
as the default branch name, as of 2022-04-28 16:53 UTC
.
All 190 public repositories are using main
as the default branch name, as of 2022-04-28 16:53 UTC
.
creativecommons
GitHub OrganizationAll 8 private repositories are using main
as the default branch name, as of 2022-04-28 16:53 UTC
.
Of the 72 public repositories, there are still 4 (6%) using a deprecated default branch name, as of 2022-04-28 16:53 UTC
:
Repository | Default Branch |
---|---|
candela-utility |
master |
creativecommons.github.io |
master |
queulat |
master |
rubycas-client-rails |
master |
audit script:
#!/usr/bin/env python3
# Standard library
import datetime
import os
# Third-party
from github import Github
ORGS = ["cc-archive", "creativecommons"]
GITHUB_TOKEN = os.environ["ADMIN_GITHUB_TOKEN"]
NOW = datetime.datetime.now(datetime.timezone.utc)
def print_percent(label, repos, deprecated):
percent = float(len(deprecated)) / float(len(repos)) * 100
if int(percent) == 0:
print(
f"All {len(repos)} {label} repositories are using `main` as the"
f" *default branch* name, as of `{NOW:%Y-%m-%d %H:%M %Z}`."
)
print()
print()
else:
if label == "private":
punctuation = "."
else:
punctuation = ":"
print(
f"Of the {len(repos)} {label} repositories, there are still"
f" {len(deprecated)} ({percent:.0f}%) using a deprecated"
f" *default branch* name, as of `{NOW:%Y-%m-%d %H:%M %Z}`"
f"{punctuation}"
)
print()
return percent
github_client = Github(GITHUB_TOKEN)
print("## *Default Branch* Rename Status")
print()
for org in ORGS:
cc = github_client.get_organization(org)
repos = list(cc.get_repos())
repos_private = []
repos_public = []
deprecated_private = []
deprecated_public = []
for repo in repos:
if repo.private:
repos_private.append(repo.name)
if repo.default_branch == "master":
deprecated_private.append([repo.name, repo.default_branch])
else:
repos_public.append(repo.name)
if repo.default_branch == "master":
deprecated_public.append([repo.name, repo.default_branch])
del repos
deprecated_public.sort(key=lambda l: l[0].casefold())
print(f"### [`{org}`](/{org}) GitHub Organization")
print()
print()
print("#### Private Repositories")
print()
print_percent("private", repos_private, deprecated_private)
print()
print("#### Public Repositories")
print()
percent = print_percent("public", repos_public, deprecated_public)
if int(percent) > 0:
print("| Repository | Default Branch |")
print("| ---------- | -------------- |")
for name, branch in deprecated_public:
link = f"[`{name}`](/{org}/{name})"
print(f"| {link} | `{branch}` |")
print()
Only creativecommons.github.io
remains (excluding forked repos) and it is covered by [Bug] Rename default branch to main · Issue #5 · creativecommons/creativecommons.github.io.
Description
This ticket tracks the variety of changes required to support
main
as a default branch name for thecreativecommons
andcc-archive
GitHub organizations.Rationale
(1.1. Master-slave - Terminology, Power and Oppressive Language)
While not everyone may interpret a git
master
branch as representing a "master-slave" metaphor, it is not unreasonable for anyone to do so:(Re: Replacing "master" reference in git branch names (was Re: Proposal:)
Continuing to use
master
as a default branch name is unwelcoming of too many. We should put our best face forward, not a face that others can easily interpret as hostility or white supremacy.Implementation Details
main
from being used a default branch name and track them, below.main
and track them, below.main
in those repositories within ~6 months (2020 end of November or beginning of December)Prerequisites
Additional context