Skip to content

Commit 3ac43f6

Browse files
authored
Switch master to main in CI tools and dev tools (#6363)
* Switch master to main in CI tools and dev tools - Switched master to main branch for better terminology and best practices. - This should catch most of the references in non-documentation. (will fix documentation in a later PR).
1 parent 3c6a305 commit 3ac43f6

23 files changed

+159
-164
lines changed

.github/workflows/ci-daily.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Continuous Integration - Daily
22

33
on:
44
schedule:
5-
# Checks out master by default.
5+
# Checks out main by default.
66
- cron: '0 0 * * *'
77

88
concurrency:

.github/workflows/ci-weekly.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Continuous Integration - Weekly
22

33
on:
44
schedule:
5-
# Checks out master by default.
5+
# Checks out main by default.
66
- cron: '0 0 * * 0'
77

88
concurrency:

.github/workflows/ci.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ name: Continuous Integration
22

33
on:
44
schedule:
5-
# Checks out master by default.
5+
# Checks out main by default.
66
- cron: '0 0 * * *'
77
pull_request:
88
branches:
9-
- master
9+
- main
1010

1111
concurrency:
1212
group: ${{ github.head_ref || github.run_id }}

.github/workflows/release-master.yml .github/workflows/release-main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Pre-release cirq to PyPi
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77
jobs:
88
push_to_pypi:
99
if: github.repository == 'quantumlib/Cirq'

asv.conf.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"project_url": "https://quantumai.google/cirq",
55
"repo": ".",
66
"repo_subdir": "cirq-core/",
7-
"branches": ["master"],
7+
"branches": ["main"],
88
"dvcs": "git",
99
"environment_type": "virtualenv",
1010
"show_commit_url": "https://github.com/quantumlib/Cirq/commit/",

check/build-changed-protos

+11-11
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@
1111
#
1212
# You can specify a base git revision to compare against (i.e. to use when
1313
# determining whether or not a line is considered to have "changed"). For
14-
# example, you can compare against 'origin/master' or 'HEAD~1'.
14+
# example, you can compare against 'origin/main' or 'HEAD~1'.
1515
#
1616
# If you don't specify a base revision, the following defaults will be tried, in
1717
# order, until one exists:
1818
#
19-
# 1. upstream/master
20-
# 2. origin/master
21-
# 3. master
19+
# 1. upstream/main
20+
# 2. origin/main
21+
# 3. main
2222
#
2323
# If none exists, the script fails.
2424
#
@@ -37,14 +37,14 @@ if [ -n "$1" ] && [[ $1 != -* ]]; then
3737
exit 1
3838
fi
3939
rev=$1
40-
elif [ "$(git cat-file -t upstream/master 2> /dev/null)" == "commit" ]; then
41-
rev=upstream/master
42-
elif [ "$(git cat-file -t origin/master 2> /dev/null)" == "commit" ]; then
43-
rev=origin/master
44-
elif [ "$(git cat-file -t master 2> /dev/null)" == "commit" ]; then
45-
rev=master
40+
elif [ "$(git cat-file -t upstream/main 2> /dev/null)" == "commit" ]; then
41+
rev=upstream/main
42+
elif [ "$(git cat-file -t origin/main 2> /dev/null)" == "commit" ]; then
43+
rev=origin/main
44+
elif [ "$(git cat-file -t main 2> /dev/null)" == "commit" ]; then
45+
rev=main
4646
else
47-
echo -e "\033[31mNo default revision found to compare against. Argument #1 must be what to diff against (e.g. 'origin/master' or 'HEAD~1').\033[0m" >&2
47+
echo -e "\033[31mNo default revision found to compare against. Argument #1 must be what to diff against (e.g. 'origin/main' or 'HEAD~1').\033[0m" >&2
4848
exit 1
4949
fi
5050
base="$(git merge-base "${rev}" HEAD)"

check/format-incremental

+11-11
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
#
1919
# You can specify a base git revision to compare against (i.e. to use when
2020
# determining whether or not a file is considered to have "changed"). For
21-
# example, you can compare against 'origin/master' or 'HEAD~1'.
21+
# example, you can compare against 'origin/main' or 'HEAD~1'.
2222
#
2323
# If you don't specify a base revision, the following defaults will be tried, in
2424
# order, until one exists:
2525
#
26-
# 1. upstream/master
27-
# 2. origin/master
28-
# 3. master
26+
# 1. upstream/main
27+
# 2. origin/main
28+
# 3. main
2929
#
3030
# If none exists, the script fails.
3131
################################################################################
@@ -61,14 +61,14 @@ typeset -a format_files
6161
if (( only_changed == 1 )); then
6262
# Figure out which branch to compare against.
6363
if [ -z "${rev}" ]; then
64-
if [ "$(git cat-file -t upstream/master 2> /dev/null)" == "commit" ]; then
65-
rev=upstream/master
66-
elif [ "$(git cat-file -t origin/master 2> /dev/null)" == "commit" ]; then
67-
rev=origin/master
68-
elif [ "$(git cat-file -t master 2> /dev/null)" == "commit" ]; then
69-
rev=master
64+
if [ "$(git cat-file -t upstream/main 2> /dev/null)" == "commit" ]; then
65+
rev=upstream/main
66+
elif [ "$(git cat-file -t origin/main 2> /dev/null)" == "commit" ]; then
67+
rev=origin/main
68+
elif [ "$(git cat-file -t main 2> /dev/null)" == "commit" ]; then
69+
rev=main
7070
else
71-
echo -e "\033[31mNo default revision found to compare against. Argument #1 must be what to diff against (e.g. 'origin/master' or 'HEAD~1').\033[0m" >&2
71+
echo -e "\033[31mNo default revision found to compare against. Argument #1 must be what to diff against (e.g. 'origin/main' or 'HEAD~1').\033[0m" >&2
7272
exit 1
7373
fi
7474
fi

check/pylint-changed-files

+12-12
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
# You can specify a base git revision to compare against (i.e. to use when
1010
# determining whether or not a line is considered to have "changed"). To make
1111
# the tool more consistent, it actually diffs against the most recent common
12-
# ancestor of the specified id and HEAD. So if you choose 'origin/master' you're
13-
# actually diffing against the output of 'git merge-base origin/master HEAD'.
12+
# ancestor of the specified id and HEAD. So if you choose 'origin/main' you're
13+
# actually diffing against the output of 'git merge-base origin/main HEAD'.
1414
#
1515
# If you don't specify a base revision, the following defaults will be tried,
1616
# in order, until one exists:
1717
#
18-
# 1. upstream/master
19-
# 2. origin/master
20-
# 3. master
18+
# 1. upstream/main
19+
# 2. origin/main
20+
# 3. main
2121
#
2222
# If none exists, the script fails.
2323
#
@@ -36,14 +36,14 @@ if [ -n "$1" ] && [[ $1 != -* ]]; then
3636
exit 1
3737
fi
3838
rev=$1
39-
elif [ "$(git cat-file -t upstream/master 2> /dev/null)" == "commit" ]; then
40-
rev=upstream/master
41-
elif [ "$(git cat-file -t origin/master 2> /dev/null)" == "commit" ]; then
42-
rev=origin/master
43-
elif [ "$(git cat-file -t master 2> /dev/null)" == "commit" ]; then
44-
rev=master
39+
elif [ "$(git cat-file -t upstream/main 2> /dev/null)" == "commit" ]; then
40+
rev=upstream/main
41+
elif [ "$(git cat-file -t origin/main 2> /dev/null)" == "commit" ]; then
42+
rev=origin/main
43+
elif [ "$(git cat-file -t main 2> /dev/null)" == "commit" ]; then
44+
rev=main
4545
else
46-
echo -e "\033[31mNo default revision found to compare against. Argument #1 must be what to diff against (e.g. 'origin/master' or 'HEAD~1').\033[0m" >&2
46+
echo -e "\033[31mNo default revision found to compare against. Argument #1 must be what to diff against (e.g. 'origin/main' or 'HEAD~1').\033[0m" >&2
4747
exit 1
4848
fi
4949
base="$(git merge-base "${rev}" HEAD)"

check/pytest-and-incremental-coverage

+12-12
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
# You can specify a base git revision to compare against (i.e. to use when
1010
# determining whether or not a line is considered to have "changed"). To make
1111
# the tool more consistent, it actually diffs against the most recent common
12-
# ancestor of the specified id and HEAD. So if you choose 'origin/master' you're
13-
# actually diffing against the output of 'git merge-base origin/master HEAD'.
12+
# ancestor of the specified id and HEAD. So if you choose 'origin/main' you're
13+
# actually diffing against the output of 'git merge-base origin/main HEAD'.
1414
#
1515
# If you don't specify a base revision, the following defaults will be tried,
1616
# in order, until one exists:
1717
#
18-
# 1. upstream/master
19-
# 2. origin/master
20-
# 3. master
18+
# 1. upstream/main
19+
# 2. origin/main
20+
# 3. main
2121
#
2222
# If none exists, the script fails.
2323
################################################################################
@@ -50,14 +50,14 @@ if [ -n "${BASEREV}" ]; then
5050
exit 1
5151
fi
5252
rev="${BASEREV}"
53-
elif [ "$(git cat-file -t upstream/master 2> /dev/null)" == "commit" ]; then
54-
rev=upstream/master
55-
elif [ "$(git cat-file -t origin/master 2> /dev/null)" == "commit" ]; then
56-
rev=origin/master
57-
elif [ "$(git cat-file -t master 2> /dev/null)" == "commit" ]; then
58-
rev=master
53+
elif [ "$(git cat-file -t upstream/main 2> /dev/null)" == "commit" ]; then
54+
rev=upstream/main
55+
elif [ "$(git cat-file -t origin/main 2> /dev/null)" == "commit" ]; then
56+
rev=origin/main
57+
elif [ "$(git cat-file -t main 2> /dev/null)" == "commit" ]; then
58+
rev=main
5959
else
60-
echo -e "\033[31mNo default revision found to compare against. Argument #1 must be what to diff against (e.g. 'origin/master' or 'HEAD~1').\033[0m" >&2
60+
echo -e "\033[31mNo default revision found to compare against. Argument #1 must be what to diff against (e.g. 'origin/main' or 'HEAD~1').\033[0m" >&2
6161
exit 1
6262
fi
6363
base="$(git merge-base "${rev}" HEAD)"

check/pytest-changed-files

+11-11
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@
1212
#
1313
# You can specify a base git revision to compare against (i.e. to use when
1414
# determining whether or not a file is considered to have "changed"). For
15-
# example, you can compare against 'origin/master' or 'HEAD~1'.
15+
# example, you can compare against 'origin/main' or 'HEAD~1'.
1616
#
1717
# If you don't specify a base revision, the following defaults will be tried, in
1818
# order, until one exists:
1919
#
20-
# 1. upstream/master
21-
# 2. origin/master
22-
# 3. master
20+
# 1. upstream/main
21+
# 2. origin/main
22+
# 3. main
2323
#
2424
# If none exists, the script fails.
2525
#
@@ -41,14 +41,14 @@ if [ -n "$1" ] && [[ $1 != -* ]]; then
4141
fi
4242
rev=$1
4343
rest=( "${@:2}" )
44-
elif [ "$(git cat-file -t upstream/master 2> /dev/null)" == "commit" ]; then
45-
rev=upstream/master
46-
elif [ "$(git cat-file -t origin/master 2> /dev/null)" == "commit" ]; then
47-
rev=origin/master
48-
elif [ "$(git cat-file -t master 2> /dev/null)" == "commit" ]; then
49-
rev=master
44+
elif [ "$(git cat-file -t upstream/main 2> /dev/null)" == "commit" ]; then
45+
rev=upstream/main
46+
elif [ "$(git cat-file -t origin/main 2> /dev/null)" == "commit" ]; then
47+
rev=origin/main
48+
elif [ "$(git cat-file -t main 2> /dev/null)" == "commit" ]; then
49+
rev=main
5050
else
51-
echo -e "\033[31mNo default revision found to compare against. Argument #1 must be what to diff against (e.g. 'origin/master' or 'HEAD~1').\033[0m" >&2
51+
echo -e "\033[31mNo default revision found to compare against. Argument #1 must be what to diff against (e.g. 'origin/main' or 'HEAD~1').\033[0m" >&2
5252
exit 1
5353
fi
5454
echo "Comparing against revision '${rev}'." >&2

check/pytest-changed-files-and-incremental-coverage

+12-12
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
# You can specify a base git revision to compare against (i.e. to use when
1616
# determining whether or not a line is considered to have "changed"). To make
1717
# the tool more consistent, it actually diffs against the most recent common
18-
# ancestor of the specified id and HEAD. So if you choose 'origin/master' you're
19-
# actually diffing against the output of 'git merge-base origin/master HEAD'.
18+
# ancestor of the specified id and HEAD. So if you choose 'origin/main' you're
19+
# actually diffing against the output of 'git merge-base origin/main HEAD'.
2020
#
2121
# If you don't specify a base revision, the following defaults will be tried,
2222
# in order, until one exists:
2323
#
24-
# 1. upstream/master
25-
# 2. origin/master
26-
# 3. master
24+
# 1. upstream/main
25+
# 2. origin/main
26+
# 3. main
2727
#
2828
# If none exists, the script fails.
2929
################################################################################
@@ -39,14 +39,14 @@ if [ -n "$1" ] && [[ $1 != -* ]]; then
3939
exit 1
4040
fi
4141
rev=$1
42-
elif [ "$(git cat-file -t upstream/master 2> /dev/null)" == "commit" ]; then
43-
rev=upstream/master
44-
elif [ "$(git cat-file -t origin/master 2> /dev/null)" == "commit" ]; then
45-
rev=origin/master
46-
elif [ "$(git cat-file -t master 2> /dev/null)" == "commit" ]; then
47-
rev=master
42+
elif [ "$(git cat-file -t upstream/main 2> /dev/null)" == "commit" ]; then
43+
rev=upstream/main
44+
elif [ "$(git cat-file -t origin/main 2> /dev/null)" == "commit" ]; then
45+
rev=origin/main
46+
elif [ "$(git cat-file -t main 2> /dev/null)" == "commit" ]; then
47+
rev=main
4848
else
49-
echo -e "\033[31mNo default revision found to compare against. Argument #1 must be what to diff against (e.g. 'origin/master' or 'HEAD~1').\033[0m" >&2
49+
echo -e "\033[31mNo default revision found to compare against. Argument #1 must be what to diff against (e.g. 'origin/main' or 'HEAD~1').\033[0m" >&2
5050
exit 1
5151
fi
5252
base="$(git merge-base "${rev}" HEAD)"

codecov.yml

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
comment: false
2+
13
coverage:
24
status:
35
project:

0 commit comments

Comments
 (0)