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

Rename master to main #1257

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Build

on:
push:
branches: ['master']
branches: ['main']
pull_request:
branches: ['*']

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Check Release
on:
push:
branches: ["master"]
branches: ["main"]
pull_request:
branches: ["*"]

Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# jupyterlab-git

[![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 -->
[![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 -->
[![All Contributors](https://img.shields.io/badge/all_contributors-29-orange.svg?style=flat-square)](#contributors-)

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

A JupyterLab extension for version control using Git

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

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).
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).

## Requirements

Expand Down Expand Up @@ -193,9 +193,9 @@ Possible fixes:

## Contributing

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

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

### Development install

Expand Down
26 changes: 13 additions & 13 deletions jupyterlab_git/tests/test_branch.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"branch,expected",
[
("refs/heads/feature-foo", False),
("refs/heads/master", False),
("refs/heads/main", False),
("refs/remotes/origin/feature-foo", True),
("refs/remotes/origin/HEAD", True),
("refs/stash", False),
Expand Down Expand Up @@ -353,7 +353,7 @@ async def test_get_current_branch_detached_success():
# Given
process_output = [
"* (HEAD detached at origin/feature-foo)",
" master",
" main",
" remotes/origin/feature-foo",
" remotes/origin/HEAD",
]
Expand Down Expand Up @@ -406,8 +406,8 @@ async def test_get_current_branch_detached_failure():
@pytest.mark.parametrize(
"branch,upstream,remotename",
[
("feature-foo", "master", "origin/withslash"),
("master", "master", "origin"),
("feature-foo", "main", "origin/withslash"),
("main", "main", "origin"),
("feature/bar", "feature-foo", ""),
# Test upstream branch name starts with a letter contained in remote name
("rbranch", "rbranch", "origin"),
Expand Down Expand Up @@ -603,12 +603,12 @@ async def test_branch_success():
# Given
process_output_heads = [
"feature-foo\tabcdefghijklmnopqrstuvwxyz01234567890123\torigin/feature-foo\t*",
"master\tabcdefghijklmnopqrstuvwxyz01234567890123\torigin/master\t ",
"main\tabcdefghijklmnopqrstuvwxyz01234567890123\torigin/main\t ",
"feature-bar\t01234567899999abcdefghijklmnopqrstuvwxyz\t\t ",
]
process_output_remotes = [
"origin/feature-foo\tabcdefghijklmnopqrstuvwxyz01234567890123",
"origin/master\tabcdefghijklmnopqrstuvwxyz01234567890123",
"origin/main\tabcdefghijklmnopqrstuvwxyz01234567890123",
]

mock_execute.side_effect = [
Expand All @@ -632,8 +632,8 @@ async def test_branch_success():
{
"is_current_branch": False,
"is_remote_branch": False,
"name": "master",
"upstream": "origin/master",
"name": "main",
"upstream": "origin/main",
"top_commit": "abcdefghijklmnopqrstuvwxyz01234567890123",
"tag": None,
},
Expand All @@ -656,7 +656,7 @@ async def test_branch_success():
{
"is_current_branch": False,
"is_remote_branch": True,
"name": "origin/master",
"name": "origin/main",
"upstream": None,
"top_commit": "abcdefghijklmnopqrstuvwxyz01234567890123",
"tag": None,
Expand Down Expand Up @@ -745,14 +745,14 @@ async def test_branch_success_detached_head():
with patch("jupyterlab_git.git.execute") as mock_execute:
# Given
process_output_heads = [
"master\tabcdefghijklmnopqrstuvwxyz01234567890123\torigin/master\t "
"main\tabcdefghijklmnopqrstuvwxyz01234567890123\torigin/main\t "
]
process_output_remotes = [
"origin/feature-foo\tabcdefghijklmnopqrstuvwxyz01234567890123"
]
detached_head_output = [
"* (HEAD detached at origin/feature-foo)",
" master",
" main",
" remotes/origin/feature-foo",
]

Expand All @@ -773,8 +773,8 @@ async def test_branch_success_detached_head():
{
"is_current_branch": False,
"is_remote_branch": False,
"name": "master",
"upstream": "origin/master",
"name": "main",
"upstream": "origin/main",
"top_commit": "abcdefghijklmnopqrstuvwxyz01234567890123",
"tag": None,
},
Expand Down
6 changes: 3 additions & 3 deletions jupyterlab_git/tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ async def test_git_get_config_multiline(mock_execute, jp_fetch, jp_root_dir):
'" $(git rev-parse --abbrev-ref HEAD); printf "\n'
"Most-active files, with churn count\n"
'"; git churn | head -7; }; f\n'
'alias.topic-base-branch-name=!f(){ printf "master\n'
'alias.topic-base-branch-name=!f(){ printf "main\n'
'"; };f\n'
'alias.topic-start=!f(){ topic_branch="$1"; git topic-create "$topic_branch"; git topic-push; };f'
)
Expand Down Expand Up @@ -89,7 +89,7 @@ async def test_git_get_config_accepted_multiline(mock_execute, jp_fetch, jp_root
'" $(git rev-parse --abbrev-ref HEAD); printf "\n'
"Most-active files, with churn count\n"
'"; git churn | head -7; }; f\n'
'alias.topic-base-branch-name=!f(){ printf "master\n'
'alias.topic-base-branch-name=!f(){ printf "main\n'
'"; };f\n'
'alias.topic-start=!f(){ topic_branch="$1"; git topic-create "$topic_branch"; git topic-push; };f'
)
Expand All @@ -116,7 +116,7 @@ async def test_git_get_config_accepted_multiline(mock_execute, jp_fetch, jp_root
'" $(git rev-parse --abbrev-ref HEAD); printf "\n'
"Most-active files, with churn count\n"
'"; git churn | head -7; }; f',
"alias.topic-base-branch-name": '!f(){ printf "master\n"; };f',
"alias.topic-base-branch-name": '!f(){ printf "main\n"; };f',
},
}

Expand Down
6 changes: 3 additions & 3 deletions jupyterlab_git/tests/test_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,8 @@ async def test_branch_handler_localbranch(mock_git, jp_fetch, jp_root_dir):
{
"is_current_branch": False,
"is_remote_branch": False,
"name": "master",
"upstream": "origin/master",
"name": "main",
"upstream": "origin/main",
"top_commit": "abcdefghijklmnopqrstuvwxyz01234567890123",
"tag": None,
},
Expand All @@ -262,7 +262,7 @@ async def test_branch_handler_localbranch(mock_git, jp_fetch, jp_root_dir):
{
"is_current_branch": False,
"is_remote_branch": True,
"name": "origin/master",
"name": "origin/main",
"upstream": None,
"top_commit": "abcdefghijklmnopqrstuvwxyz01234567890123",
"tag": None,
Expand Down
34 changes: 17 additions & 17 deletions jupyterlab_git/tests/test_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
[
(
(
"## master",
"## main",
"A notebook with spaces.ipynb",
"M notebook with λ.ipynb",
"M binary file.gif",
Expand All @@ -29,7 +29,7 @@
),
{
"code": 0,
"branch": "master",
"branch": "main",
"remote": None,
"ahead": 0,
"behind": 0,
Expand Down Expand Up @@ -74,11 +74,11 @@
),
# Empty answer
(
("## master",),
("## main",),
(""),
{
"code": 0,
"branch": "master",
"branch": "main",
"remote": None,
"ahead": 0,
"behind": 0,
Expand All @@ -87,59 +87,59 @@
),
# With upstream only
(
("## master...origin/master",),
("## main...origin/main",),
(""),
{
"code": 0,
"branch": "master",
"remote": "origin/master",
"branch": "main",
"remote": "origin/main",
"ahead": 0,
"behind": 0,
"files": [],
},
),
# Ahead only
(
("## master...origin/master [ahead 15]",),
("## main...origin/main [ahead 15]",),
(""),
{
"code": 0,
"branch": "master",
"remote": "origin/master",
"branch": "main",
"remote": "origin/main",
"ahead": 15,
"behind": 0,
"files": [],
},
),
# Behind only
(
("## master...origin/master [behind 5]",),
("## main...origin/main [behind 5]",),
(""),
{
"code": 0,
"branch": "master",
"remote": "origin/master",
"branch": "main",
"remote": "origin/main",
"ahead": 0,
"behind": 5,
"files": [],
},
),
# Ahead and behind
(
("## master...origin/master [ahead 3, behind 5]",),
("## main...origin/main [ahead 3, behind 5]",),
(""),
{
"code": 0,
"branch": "master",
"remote": "origin/master",
"branch": "main",
"remote": "origin/main",
"ahead": 3,
"behind": 5,
"files": [],
},
),
# Initial commit
(
("## No commits yet on master",),
("## No commits yet on main",),
(""),
{
"code": 0,
Expand Down
12 changes: 6 additions & 6 deletions specification/Git_REST_API.yml
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ on git command failure
```

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

# URL:
# ```bash
Expand All @@ -821,7 +821,7 @@ on git command failure
# ```bash
# {
# "origin": "remote-repository-to-Pull-from",
# "master": "branch-to-Pull-into",
# "main": "branch-to-Pull-into",
# "curr_fb_path": "current/path/in/filebrowser/widget"
# }
# ```
Expand All @@ -843,13 +843,13 @@ on git command failure
# ```bash
# {
# "code": 11,
# "command": "git pull origin master"
# "command": "git pull origin main"
# "message": "Git pull command error and help tips"
# }
# ```

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

# URL:
# ```bash
Expand All @@ -859,7 +859,7 @@ on git command failure
# ```bash
# {
# "origin": "remote-repository-to-Push-into",
# "master": "branch-to-Push-from",
# "main": "branch-to-Push-from",
# "curr_fb_path": "current/path/in/filebrowser/widget"
# }
# ```
Expand All @@ -881,7 +881,7 @@ on git command failure
# ```bash
# {
# "code": 11,
# "command": "git push origin master"
# "command": "git push origin main"
# "message": "Git push command error and help tips"
# }
# ```
Expand Down
8 changes: 4 additions & 4 deletions src/__tests__/model.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ describe('IGitExtension', () => {
expect(model.status.files).toHaveLength(0);

model.pathRepository = DEFAULT_REPOSITORY_PATH;
const branch = 'master';
const branch = 'main';
await model.ready;
status = {
branch,
Expand All @@ -236,7 +236,7 @@ describe('IGitExtension', () => {
});

it('should emit a signal if when set', async () => {
const branch = 'master';
const branch = 'main';
const status: Partial<Git.IStatusResult> = {
branch,
remote: null,
Expand Down Expand Up @@ -337,7 +337,7 @@ describe('IGitExtension', () => {
{
is_current_branch: true,
is_remote_branch: false,
name: 'master',
name: 'main',
upstream: null,
top_commit: '52263564aac988a0888060becc3c76d1023e680f',
tag: null
Expand All @@ -354,7 +354,7 @@ describe('IGitExtension', () => {
current_branch: {
is_current_branch: true,
is_remote_branch: false,
name: 'master',
name: 'main',
upstream: null,
top_commit: '52263564aac988a0888060becc3c76d1023e680f',
tag: null
Expand Down
Loading
Loading