Skip to content

Commit db7bd77

Browse files
authored
Rename master to main (#1257)
* Rename master to main * Remove unneeded await * More integration tests fixes * Lint the code
1 parent a49a53a commit db7bd77

File tree

15 files changed

+87
-85
lines changed

15 files changed

+87
-85
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Build
22

33
on:
44
push:
5-
branches: ['master']
5+
branches: ['main']
66
pull_request:
77
branches: ['*']
88

.github/workflows/check-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name: Check Release
22
on:
33
push:
4-
branches: ["master"]
4+
branches: ["main"]
55
pull_request:
66
branches: ["*"]
77

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# jupyterlab-git
22

3-
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/jupyterlab/jupyterlab-git/master?urlpath=lab/tree/examples/demo.ipynb) [![Github Actions Status](https://github.com/jupyterlab/jupyterlab-git/actions/workflows/build.yml/badge.svg)](https://github.com/jupyterlab/jupyterlab-git/actions/workflows/build.yml) [![Version](https://img.shields.io/npm/v/@jupyterlab/git.svg)](https://www.npmjs.com/package/@jupyterlab/git) [![Version](https://img.shields.io/pypi/v/jupyterlab-git.svg)](https://pypi.org/project/jupyterlab-git/) [![Downloads](https://img.shields.io/npm/dm/@jupyterlab/git.svg)](https://www.npmjs.com/package/@jupyterlab/git) [![Version](https://img.shields.io/conda/vn/conda-forge/jupyterlab-git.svg)](https://anaconda.org/conda-forge/jupyterlab-git) [![Downloads](https://img.shields.io/conda/dn/conda-forge/jupyterlab-git.svg)](https://anaconda.org/conda-forge/jupyterlab-git)<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
3+
[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/jupyterlab/jupyterlab-git/main?urlpath=lab/tree/examples/demo.ipynb) [![Github Actions Status](https://github.com/jupyterlab/jupyterlab-git/actions/workflows/build.yml/badge.svg)](https://github.com/jupyterlab/jupyterlab-git/actions/workflows/build.yml) [![Version](https://img.shields.io/npm/v/@jupyterlab/git.svg)](https://www.npmjs.com/package/@jupyterlab/git) [![Version](https://img.shields.io/pypi/v/jupyterlab-git.svg)](https://pypi.org/project/jupyterlab-git/) [![Downloads](https://img.shields.io/npm/dm/@jupyterlab/git.svg)](https://www.npmjs.com/package/@jupyterlab/git) [![Version](https://img.shields.io/conda/vn/conda-forge/jupyterlab-git.svg)](https://anaconda.org/conda-forge/jupyterlab-git) [![Downloads](https://img.shields.io/conda/dn/conda-forge/jupyterlab-git.svg)](https://anaconda.org/conda-forge/jupyterlab-git)<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section -->
44
[![All Contributors](https://img.shields.io/badge/all_contributors-29-orange.svg?style=flat-square)](#contributors-)
55

66
<!-- ALL-CONTRIBUTORS-BADGE:END -->
77

88
A JupyterLab extension for version control using Git
99

10-
![ui_glow_up](https://raw.githubusercontent.com/jupyterlab/jupyterlab-git/master/docs/figs/preview.gif)
10+
![ui_glow_up](https://raw.githubusercontent.com/jupyterlab/jupyterlab-git/main/docs/figs/preview.gif)
1111

12-
To see the extension in action, open the example notebook included in the Binder [demo](https://mybinder.org/v2/gh/jupyterlab/jupyterlab-git/master?urlpath=lab/tree/examples/demo.ipynb).
12+
To see the extension in action, open the example notebook included in the Binder [demo](https://mybinder.org/v2/gh/jupyterlab/jupyterlab-git/main?urlpath=lab/tree/examples/demo.ipynb).
1313

1414
## Requirements
1515

@@ -193,9 +193,9 @@ Possible fixes:
193193

194194
## Contributing
195195

196-
If you would like to contribute to the project, please read our [contributor documentation](https://github.com/jupyterlab/jupyterlab/blob/master/CONTRIBUTING.md).
196+
If you would like to contribute to the project, please read our [contributor documentation](https://github.com/jupyterlab/jupyterlab/blob/main/CONTRIBUTING.md).
197197

198-
JupyterLab follows the official [Jupyter Code of Conduct](https://github.com/jupyter/governance/blob/master/conduct/code_of_conduct.md).
198+
JupyterLab follows the official [Jupyter Code of Conduct](https://github.com/jupyter/governance/blob/main/conduct/code_of_conduct.md).
199199

200200
### Development install
201201

jupyterlab_git/tests/test_branch.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"branch,expected",
1313
[
1414
("refs/heads/feature-foo", False),
15-
("refs/heads/master", False),
15+
("refs/heads/main", False),
1616
("refs/remotes/origin/feature-foo", True),
1717
("refs/remotes/origin/HEAD", True),
1818
("refs/stash", False),
@@ -403,7 +403,7 @@ async def test_get_current_branch_detached_success():
403403
# Given
404404
process_output = [
405405
"* (HEAD detached at origin/feature-foo)",
406-
" master",
406+
" main",
407407
" remotes/origin/feature-foo",
408408
" remotes/origin/HEAD",
409409
]
@@ -466,8 +466,8 @@ async def test_get_current_branch_detached_failure():
466466
@pytest.mark.parametrize(
467467
"branch,upstream,remotename",
468468
[
469-
("feature-foo", "master", "origin/withslash"),
470-
("master", "master", "origin"),
469+
("feature-foo", "main", "origin/withslash"),
470+
("main", "main", "origin"),
471471
("feature/bar", "feature-foo", ""),
472472
# Test upstream branch name starts with a letter contained in remote name
473473
("rbranch", "rbranch", "origin"),
@@ -698,12 +698,12 @@ async def test_branch_success():
698698
# Given
699699
process_output_heads = [
700700
"feature-foo\tabcdefghijklmnopqrstuvwxyz01234567890123\torigin/feature-foo\t*",
701-
"master\tabcdefghijklmnopqrstuvwxyz01234567890123\torigin/master\t ",
701+
"main\tabcdefghijklmnopqrstuvwxyz01234567890123\torigin/main\t ",
702702
"feature-bar\t01234567899999abcdefghijklmnopqrstuvwxyz\t\t ",
703703
]
704704
process_output_remotes = [
705705
"origin/feature-foo\tabcdefghijklmnopqrstuvwxyz01234567890123",
706-
"origin/master\tabcdefghijklmnopqrstuvwxyz01234567890123",
706+
"origin/main\tabcdefghijklmnopqrstuvwxyz01234567890123",
707707
]
708708

709709
mock_execute.side_effect = [
@@ -727,8 +727,8 @@ async def test_branch_success():
727727
{
728728
"is_current_branch": False,
729729
"is_remote_branch": False,
730-
"name": "master",
731-
"upstream": "origin/master",
730+
"name": "main",
731+
"upstream": "origin/main",
732732
"top_commit": "abcdefghijklmnopqrstuvwxyz01234567890123",
733733
"tag": None,
734734
},
@@ -751,7 +751,7 @@ async def test_branch_success():
751751
{
752752
"is_current_branch": False,
753753
"is_remote_branch": True,
754-
"name": "origin/master",
754+
"name": "origin/main",
755755
"upstream": None,
756756
"top_commit": "abcdefghijklmnopqrstuvwxyz01234567890123",
757757
"tag": None,
@@ -855,14 +855,14 @@ async def test_branch_success_detached_head():
855855
with patch("jupyterlab_git.git.execute") as mock_execute:
856856
# Given
857857
process_output_heads = [
858-
"master\tabcdefghijklmnopqrstuvwxyz01234567890123\torigin/master\t "
858+
"main\tabcdefghijklmnopqrstuvwxyz01234567890123\torigin/main\t "
859859
]
860860
process_output_remotes = [
861861
"origin/feature-foo\tabcdefghijklmnopqrstuvwxyz01234567890123"
862862
]
863863
detached_head_output = [
864864
"* (HEAD detached at origin/feature-foo)",
865-
" master",
865+
" main",
866866
" remotes/origin/feature-foo",
867867
]
868868

@@ -883,8 +883,8 @@ async def test_branch_success_detached_head():
883883
{
884884
"is_current_branch": False,
885885
"is_remote_branch": False,
886-
"name": "master",
887-
"upstream": "origin/master",
886+
"name": "main",
887+
"upstream": "origin/main",
888888
"top_commit": "abcdefghijklmnopqrstuvwxyz01234567890123",
889889
"tag": None,
890890
},

jupyterlab_git/tests/test_config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ async def test_git_get_config_multiline(mock_execute, jp_fetch, jp_root_dir):
5252
'" $(git rev-parse --abbrev-ref HEAD); printf "\n'
5353
"Most-active files, with churn count\n"
5454
'"; git churn | head -7; }; f\n'
55-
'alias.topic-base-branch-name=!f(){ printf "master\n'
55+
'alias.topic-base-branch-name=!f(){ printf "main\n'
5656
'"; };f\n'
5757
'alias.topic-start=!f(){ topic_branch="$1"; git topic-create "$topic_branch"; git topic-push; };f'
5858
)
@@ -101,7 +101,7 @@ async def test_git_get_config_accepted_multiline(mock_execute, jp_fetch, jp_root
101101
'" $(git rev-parse --abbrev-ref HEAD); printf "\n'
102102
"Most-active files, with churn count\n"
103103
'"; git churn | head -7; }; f\n'
104-
'alias.topic-base-branch-name=!f(){ printf "master\n'
104+
'alias.topic-base-branch-name=!f(){ printf "main\n'
105105
'"; };f\n'
106106
'alias.topic-start=!f(){ topic_branch="$1"; git topic-create "$topic_branch"; git topic-push; };f'
107107
)
@@ -134,7 +134,7 @@ async def test_git_get_config_accepted_multiline(mock_execute, jp_fetch, jp_root
134134
'" $(git rev-parse --abbrev-ref HEAD); printf "\n'
135135
"Most-active files, with churn count\n"
136136
'"; git churn | head -7; }; f',
137-
"alias.topic-base-branch-name": '!f(){ printf "master\n"; };f',
137+
"alias.topic-base-branch-name": '!f(){ printf "main\n"; };f',
138138
},
139139
}
140140

jupyterlab_git/tests/test_handlers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,8 @@ async def test_branch_handler_localbranch(mock_git, jp_fetch, jp_root_dir):
258258
{
259259
"is_current_branch": False,
260260
"is_remote_branch": False,
261-
"name": "master",
262-
"upstream": "origin/master",
261+
"name": "main",
262+
"upstream": "origin/main",
263263
"top_commit": "abcdefghijklmnopqrstuvwxyz01234567890123",
264264
"tag": None,
265265
},
@@ -282,7 +282,7 @@ async def test_branch_handler_localbranch(mock_git, jp_fetch, jp_root_dir):
282282
{
283283
"is_current_branch": False,
284284
"is_remote_branch": True,
285-
"name": "origin/master",
285+
"name": "origin/main",
286286
"upstream": None,
287287
"top_commit": "abcdefghijklmnopqrstuvwxyz01234567890123",
288288
"tag": None,

jupyterlab_git/tests/test_status.py

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
[
1515
(
1616
(
17-
"## master",
17+
"## main",
1818
"A notebook with spaces.ipynb",
1919
"M notebook with λ.ipynb",
2020
"M binary file.gif",
@@ -29,7 +29,7 @@
2929
),
3030
{
3131
"code": 0,
32-
"branch": "master",
32+
"branch": "main",
3333
"remote": None,
3434
"ahead": 0,
3535
"behind": 0,
@@ -74,11 +74,11 @@
7474
),
7575
# Empty answer
7676
(
77-
("## master",),
77+
("## main",),
7878
(""),
7979
{
8080
"code": 0,
81-
"branch": "master",
81+
"branch": "main",
8282
"remote": None,
8383
"ahead": 0,
8484
"behind": 0,
@@ -87,59 +87,59 @@
8787
),
8888
# With upstream only
8989
(
90-
("## master...origin/master",),
90+
("## main...origin/main",),
9191
(""),
9292
{
9393
"code": 0,
94-
"branch": "master",
95-
"remote": "origin/master",
94+
"branch": "main",
95+
"remote": "origin/main",
9696
"ahead": 0,
9797
"behind": 0,
9898
"files": [],
9999
},
100100
),
101101
# Ahead only
102102
(
103-
("## master...origin/master [ahead 15]",),
103+
("## main...origin/main [ahead 15]",),
104104
(""),
105105
{
106106
"code": 0,
107-
"branch": "master",
108-
"remote": "origin/master",
107+
"branch": "main",
108+
"remote": "origin/main",
109109
"ahead": 15,
110110
"behind": 0,
111111
"files": [],
112112
},
113113
),
114114
# Behind only
115115
(
116-
("## master...origin/master [behind 5]",),
116+
("## main...origin/main [behind 5]",),
117117
(""),
118118
{
119119
"code": 0,
120-
"branch": "master",
121-
"remote": "origin/master",
120+
"branch": "main",
121+
"remote": "origin/main",
122122
"ahead": 0,
123123
"behind": 5,
124124
"files": [],
125125
},
126126
),
127127
# Ahead and behind
128128
(
129-
("## master...origin/master [ahead 3, behind 5]",),
129+
("## main...origin/main [ahead 3, behind 5]",),
130130
(""),
131131
{
132132
"code": 0,
133-
"branch": "master",
134-
"remote": "origin/master",
133+
"branch": "main",
134+
"remote": "origin/main",
135135
"ahead": 3,
136136
"behind": 5,
137137
"files": [],
138138
},
139139
),
140140
# Initial commit
141141
(
142-
("## No commits yet on master",),
142+
("## No commits yet on main",),
143143
(""),
144144
{
145145
"code": 0,

specification/Git_REST_API.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,7 @@ on git command failure
811811
```
812812

813813
# ### git pull - Fetch from and integrate with another repository or a local branch
814-
# Request with a specified remote-repo "origin", a specified branch "master", and a "curr_fb_path" to fetch.
814+
# Request with a specified remote-repo "origin", a specified branch "main", and a "curr_fb_path" to fetch.
815815

816816
# URL:
817817
# ```bash
@@ -821,7 +821,7 @@ on git command failure
821821
# ```bash
822822
# {
823823
# "origin": "remote-repository-to-Pull-from",
824-
# "master": "branch-to-Pull-into",
824+
# "main": "branch-to-Pull-into",
825825
# "curr_fb_path": "current/path/in/filebrowser/widget"
826826
# }
827827
# ```
@@ -843,13 +843,13 @@ on git command failure
843843
# ```bash
844844
# {
845845
# "code": 11,
846-
# "command": "git pull origin master"
846+
# "command": "git pull origin main"
847847
# "message": "Git pull command error and help tips"
848848
# }
849849
# ```
850850

851851
# ### git push - Update remote refs along with associated objects
852-
# Request with a specified remote-repo "origin", a specified branch "master", and a "curr_fb_path" to push.
852+
# Request with a specified remote-repo "origin", a specified branch "main", and a "curr_fb_path" to push.
853853

854854
# URL:
855855
# ```bash
@@ -859,7 +859,7 @@ on git command failure
859859
# ```bash
860860
# {
861861
# "origin": "remote-repository-to-Push-into",
862-
# "master": "branch-to-Push-from",
862+
# "main": "branch-to-Push-from",
863863
# "curr_fb_path": "current/path/in/filebrowser/widget"
864864
# }
865865
# ```
@@ -881,7 +881,7 @@ on git command failure
881881
# ```bash
882882
# {
883883
# "code": 11,
884-
# "command": "git push origin master"
884+
# "command": "git push origin main"
885885
# "message": "Git push command error and help tips"
886886
# }
887887
# ```

src/__tests__/model.spec.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ describe('IGitExtension', () => {
215215
expect(model.status.files).toHaveLength(0);
216216

217217
model.pathRepository = DEFAULT_REPOSITORY_PATH;
218-
const branch = 'master';
218+
const branch = 'main';
219219
await model.ready;
220220
status = {
221221
branch,
@@ -236,7 +236,7 @@ describe('IGitExtension', () => {
236236
});
237237

238238
it('should emit a signal if when set', async () => {
239-
const branch = 'master';
239+
const branch = 'main';
240240
const status: Partial<Git.IStatusResult> = {
241241
branch,
242242
remote: null,
@@ -337,7 +337,7 @@ describe('IGitExtension', () => {
337337
{
338338
is_current_branch: true,
339339
is_remote_branch: false,
340-
name: 'master',
340+
name: 'main',
341341
upstream: null,
342342
top_commit: '52263564aac988a0888060becc3c76d1023e680f',
343343
tag: null
@@ -354,7 +354,7 @@ describe('IGitExtension', () => {
354354
current_branch: {
355355
is_current_branch: true,
356356
is_remote_branch: false,
357-
name: 'master',
357+
name: 'main',
358358
upstream: null,
359359
top_commit: '52263564aac988a0888060becc3c76d1023e680f',
360360
tag: null

0 commit comments

Comments
 (0)