Skip to content

Commit 53e59c8

Browse files
committed
Rename default branch to ‘main’
Signed-off-by: Anders Kaseorg <[email protected]>
1 parent 285a946 commit 53e59c8

File tree

13 files changed

+39
-39
lines changed

13 files changed

+39
-39
lines changed

.github/workflows/zulip-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: build
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77
pull_request:
88

99
jobs:

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# Zulip API
22

3-
[![Build status](https://github.com/zulip/python-zulip-api/workflows/build/badge.svg?branch=master)](
4-
https://github.com/zulip/python-zulip-api/actions?query=branch%3Amaster+workflow%3Abuild)
5-
[![Coverage status](https://img.shields.io/codecov/c/github/zulip/python-zulip-api/master.svg)](
3+
[![Build status](https://github.com/zulip/python-zulip-api/workflows/build/badge.svg)](
4+
https://github.com/zulip/python-zulip-api/actions?query=branch%3Amain+workflow%3Abuild)
5+
[![Coverage status](https://img.shields.io/codecov/c/github/zulip/python-zulip-api)](
66
https://codecov.io/gh/zulip/python-zulip-api)
77

88
This repository contains the source code for Zulip's PyPI packages:

tools/clean-branches

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
set -e
33

44
# usage: clean-branches
5-
# Deletes any local branches which are ancestors of origin/master,
5+
# Deletes any local branches which are ancestors of origin/main,
66
# and also any branches in origin which are ancestors of
7-
# origin/master and are named like $USER-*.
7+
# origin/main and are named like $USER-*.
88

99
# usage: clean-branches --reviews
1010
# Deletes all the above mentioned branches as well as branches
@@ -18,13 +18,13 @@ fi
1818
push_args=()
1919

2020
function is_merged {
21-
! git rev-list -n 1 origin/master.."$1" | grep -q .
21+
! git rev-list -n 1 origin/main.."$1" | grep -q .
2222
}
2323

2424
function clean_ref {
2525
ref="$1"
2626
case "$ref" in
27-
*/master | */HEAD)
27+
*/main | */HEAD)
2828
return
2929
;;
3030

@@ -56,8 +56,8 @@ function clean_ref {
5656
esac
5757
}
5858

59-
if [ "$(git symbolic-ref HEAD)" != 'refs/heads/master' ]; then
60-
echo "Check out master before you run this script." >&2
59+
if [ "$(git symbolic-ref HEAD)" != 'refs/heads/main' ]; then
60+
echo "Check out main before you run this script." >&2
6161
exit 1
6262
fi
6363

tools/deploy-branch

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ branch_ref=$(git rev-list --max-count=1 "$branch")
1717
[ $? -ne 0 ] && error_out "Unknown branch: $branch"
1818

1919
if [ "$old_ref" == "$branch_ref" ]; then
20-
new_ref=master
20+
new_ref=main
2121
else
2222
ref_name=$(git describe --all --exact "$old_ref")
2323
if [ $? -eq 0 ]; then
@@ -31,12 +31,12 @@ fi
3131

3232
git fetch -p
3333

34-
git rebase origin/master "$branch"
35-
[ $? -ne 0 ] && error_out "Rebase onto origin/master failed"
34+
git rebase origin/main "$branch"
35+
[ $? -ne 0 ] && error_out "Rebase onto origin/main failed"
3636

37-
git push . HEAD:master
38-
git push origin master
39-
[ $? -ne 0 ] && error_out "Push of master to origin/master failed"
37+
git push . HEAD:main
38+
git push origin main
39+
[ $? -ne 0 ] && error_out "Push of main to origin/main failed"
4040

4141
git checkout "$new_ref"
4242
git branch -D "$branch"

tools/fetch-rebase-pull-request

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ fi
1212
request_id="$1"
1313
remote=${2:-"upstream"}
1414
git fetch "$remote" "pull/$request_id/head"
15-
git checkout -B "review-${request_id}" $remote/master
15+
git checkout -B "review-${request_id}" $remote/main
1616
git reset --hard FETCH_HEAD
1717
git pull --rebase

tools/lint-commits

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
# Edited at Line 14 Col 97 (zulip -> python-zulip-api)
55
# Please don't edit here; instead update the zulip/zulip copy and then resync this file.
66

7-
# Lint all commit messages that are newer than upstream/master if running
7+
# Lint all commit messages that are newer than upstream/main if running
88
# locally or the commits in the push or PR Gh-Actions.
99

1010
# The rules can be found in /.gitlint
@@ -16,9 +16,9 @@ $(git remote -v)
1616
" =~ '
1717
'([^[:space:]]*)[[:space:]]*(https://github\.com/|ssh://git@github\.com/|git@github\.com:)"$repository"(\.git|/)?\ \(fetch\)'
1818
' ]]; then
19-
range="${BASH_REMATCH[1]}/master..HEAD"
19+
range="${BASH_REMATCH[1]}/main..HEAD"
2020
else
21-
range="upstream/master..HEAD"
21+
range="upstream/main..HEAD"
2222
fi
2323

2424
commits=$(git log "$range" | wc -l)

tools/review

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,21 +32,21 @@ def check_git_pristine() -> None:
3232
exit("Git is not pristine:\n" + output)
3333

3434

35-
def ensure_on_clean_master() -> None:
35+
def ensure_on_clean_main() -> None:
3636
branch = get_git_branch()
37-
if branch != "master":
37+
if branch != "main":
3838
exit(f"You are still on a feature branch: {branch}")
3939
check_git_pristine()
40-
run("git fetch upstream master")
41-
run("git rebase upstream/master")
40+
run("git fetch upstream main")
41+
run("git rebase upstream/main")
4242

4343

4444
def create_pull_branch(pull_id: int) -> None:
4545
run("git fetch upstream pull/%d/head" % (pull_id,))
4646
run(f"git checkout -B review-{pull_id} FETCH_HEAD")
47-
run("git rebase upstream/master")
48-
run("git log upstream/master.. --oneline")
49-
run("git diff upstream/master.. --name-status")
47+
run("git rebase upstream/main")
48+
run("git log upstream/main.. --oneline")
49+
run("git diff upstream/main.. --name-status")
5050

5151
print()
5252
print("PR: %d" % (pull_id,))
@@ -59,7 +59,7 @@ def review_pr() -> None:
5959
except Exception:
6060
exit("please provide an integer pull request id")
6161

62-
ensure_on_clean_master()
62+
ensure_on_clean_main()
6363
create_pull_branch(pull_id)
6464

6565

zulip/integrations/bridge_with_irc/irc_mirror_backend.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def zulip_sender(self, sender_string: str) -> str:
3838

3939
def connect(self, *args: Any, **kwargs: Any) -> None:
4040
# Taken from
41-
# https://github.com/jaraco/irc/blob/master/irc/client_aio.py,
41+
# https://github.com/jaraco/irc/blob/main/irc/client_aio.py,
4242
# in particular the method of AioSimpleIRCClient
4343
self.c = self.reactor.loop.run_until_complete(self.connection.connect(*args, **kwargs))
4444
print("Listening now. Please send an IRC message to verify operation")

zulip/integrations/git/post-receive

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# stdin in the form
88
# <oldrev> <newrev> <refname>
99
# For example:
10-
# aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/master
10+
# aa453216d1b3e49e7f6f98441fa56946ddcd6a20 68f7abf4e6f922807889f52bc043ecd31b79f814 refs/heads/main
1111

1212
import os
1313
import os.path

zulip/integrations/git/zulip_git_config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
# Returns a dictionary encoding the stream and subject to send the
2020
# notification to (or None to send no notification).
2121
#
22-
# The default code below will send every commit pushed to "master" to
22+
# The default code below will send every commit pushed to "main" to
2323
# * stream "commits"
24-
# * topic "master"
24+
# * topic "main"
2525
# And similarly for branch "test-post-receive" (for use when testing).
2626
def commit_notice_destination(repo: str, branch: str, commit: str) -> Optional[Dict[str, str]]:
27-
if branch in ["master", "test-post-receive"]:
27+
if branch in ["main", "test-post-receive"]:
2828
return dict(stream=STREAM_NAME, subject=f"{branch}")
2929

3030
# Return None for cases where you don't want a notice sent

zulip/integrations/hg/zulip_changegroup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Zulip hook for Mercurial changeset pushes.
44
#
5-
# This hook is called when changesets are pushed to the master repository (ie
5+
# This hook is called when changesets are pushed to the default repository (ie
66
# `hg push`). See https://zulip.com/integrations for installation instructions.
77

88
import sys
@@ -23,7 +23,7 @@ def format_summary_line(
2323
information about the changeset and links to the changelog if a
2424
web URL has been configured:
2525
26-
Jane Doe <[email protected]> pushed 1 commit to master (170:e494a5be3393):
26+
Jane Doe <[email protected]> pushed 1 commit to default (170:e494a5be3393):
2727
"""
2828
revcount = tip - base
2929
plural = "s" if revcount > 1 else ""

zulip/integrations/openshift/post_deploy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ client = zulip.Client(
2828
def get_deployment_details() -> Dict[str, str]:
2929
# "gear deployments" output example:
3030
# Activation time - Deployment ID - Git Ref - Git SHA1
31-
# 2017-01-07 15:40:30 -0500 - 9e2b7143 - master - b9ce57c - ACTIVE
31+
# 2017-01-07 15:40:30 -0500 - 9e2b7143 - main - b9ce57c - ACTIVE
3232
dep = subprocess.check_output(["gear", "deployments"], universal_newlines=True).splitlines()[1]
3333
splits = dep.split(" - ")
3434

zulip/integrations/openshift/zulip_openshift_config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
# Returns a dictionary encoding the stream and subject to send the
1616
# notification to (or None to send no notification).
1717
#
18-
# The default code below will send every commit pushed to "master" to
18+
# The default code below will send every commit pushed to "main" to
1919
# * stream "deployments"
20-
# * topic "master"
20+
# * topic "main"
2121
# And similarly for branch "test-post-receive" (for use when testing).
2222
def deployment_notice_destination(branch: str) -> Optional[Dict[str, str]]:
23-
if branch in ["master", "test-post-receive"]:
23+
if branch in ["main", "master", "test-post-receive"]:
2424
return dict(stream="deployments", subject=f"{branch}")
2525

2626
# Return None for cases where you don't want a notice sent

0 commit comments

Comments
 (0)