Skip to content

Commit 89f4133

Browse files
committed
improve steps for reviewing pull requests
Describe two methods for obtaining the code: cloning PR branch, or adding a remote. Specify which directories one should be in when executing the code.
1 parent 7085fdb commit 89f4133

File tree

1 file changed

+22
-6
lines changed

1 file changed

+22
-6
lines changed

doc/contributing.rst

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -302,17 +302,33 @@ The only people with write access to the main repository are a small number of c
302302

303303
**Everyone can review and comment on pull requests.** Even if you are not one of the core developers you can still comment on a pull request.
304304

305-
To test pull requests locally you should:
305+
To test pull requests locally you should download the pull request branch. You can do this either by cloning the branch from the pull request:
306306

307-
- add the repository of the user proposing the pull request as a remote, :code:`git remote add user_name https://github.com/user_name/MITgcm.git` where user_name is replaced by the user name of the person who has made the pull request;
307+
::
308+
309+
git clone -b BRANCHNAME https://github.com/USERNAME/MITgcm.git
310+
311+
where `USERNAME` is replaced by the username of the person proposing the pull request, and `BRANCHNAME` is the branch from the pull request.
308312

309-
- download a local version of the branch from the pull request, :code:`git fetch user_name` followed by :code:`git checkout --track user_name/foo`;
313+
Alternatively, you can add the repository of the user proposing the pull request as a remote to your existing local repository. Move directories in to your local repository and then
310314

311-
- run tests locally; and
315+
::
316+
317+
git remote add USERNAME https://github.com/USERNAME/MITgcm.git
312318

313-
- possibly push fixes or changes directly to the pull request.
319+
where USERNAME is replaced by the user name of the person who has made the pull request. Then download the branch from the pull request
314320

315-
None of these steps, apart from the final one, require write access to the main repository. This means that anyone can review pull requests. However, unless you are one of the core developers you won't be able to directly push changes. You will instead have to make a comment describing any problems you find.
321+
::
322+
323+
git fetch USERNAME
324+
325+
and switch to the desired branch
326+
327+
::
328+
329+
git checkout --track USERNAME/foo
316330

317331

332+
You now have a local copy of the code from the pull request and can run tests locally. If you have write access to the main repository you can push fixes or changes directly to the pull request.
318333

334+
None of these steps, apart from pushing fixes back to the pull request, require write access to either the main repository or the repository of the person proposing the pull request. This means that anyone can review pull requests. However, unless you are one of the core developers you won't be able to directly push changes. You will instead have to make a comment describing any problems you find.

0 commit comments

Comments
 (0)