Skip to content
Snippets Groups Projects
Commit ec06909c authored by ovari's avatar ovari Committed by Pierre Nicolas
Browse files

developer/new-developers/working-with-gerrit.md: cleanup

Change-Id: Ieae524c8b0b4cc4fca1f9506940b3c8e126390b8
parent 5bf87bc6
No related branches found
No related tags found
No related merge requests found
Working with Gerrit
===================
# Working with Gerrit
## Account Setup
## Account setup
+ Gerrit server: <https://review.jami.net>
+ User documentation: <https://review.jami.net/Documentation/intro-user.html>
+ Jami projects on Gerrit: <https://review.jami.net/admin/repos/>
* Gerrit server: <https://review.jami.net>
* User documentation: <https://review.jami.net/Documentation/intro-user.html>
* Jami projects on Gerrit: <https://review.jami.net/admin/repos/>
1. Sign-in with your google or github account or git.jami.net account
1. Sign in with your Google, GitHub, or git.jami.net account.
2. You'll also need to [upload an SSH key](https://review.jami.net/settings/#SSHKeys) to be able to commit changes for review.
3. Don't forget to select a username.
4. Finally, the email address specified in your git config must match one the email address registered with your Gerrit account.
4. Finally, the email address specified in your git config must match one of the email addresses registered with your Gerrit account.
*Note for Savoir-faire Linux Inc. employees: please continue to use your @savoirfairelinux.com email address.*
```{important}
For Savoir-faire Linux Inc. employees: please continue to use your @savoirfairelinux.com email address.
```
### To Know your Git Config
### To view your Git config
`git config --list`
### To Test your SSH Access
### To test your SSH access
To check that your SSH access is properly setup, run the following command:
To check that your SSH access is properly set up, run the following command:
`ssh -p 29420 <username>@review.jami.net`
<username> is your Gerrit username, that you should have set during the account creation. If not, you can do that here.
<username> is your Gerrit username that you should have set during the account creation. If not, you can do that here.
```
If your access is granted, you should see a message like:
```bash
**** Welcome to Gerrit Code Review ****
Hi, you have successfully connected over SSH.
......@@ -41,23 +42,24 @@ Hi, you have successfully connected over SSH.
Connection to review.jami.net closed.
```
## Git Configuration
## Git configuration
Gerrit is the official git repository.
Gerrit is the official Git repository.
### To update the configuration
You must update your remote information to use now the Gerrit repository. To do that, update your origin url:
You must update your remote information to now use the Gerrit repository.
To do that, update your origin URL:
`git remote set-url origin ssh://<username>@review.jami.net:29420/<project_name>`
Replace `<project_name>` by the correct project (example: jami-daemon)
Replace `<project_name>` with the correct project (example: jami-daemon).
Or clone the existing repository if you want to start fresh.
## To Push by Default in refs/for/master
You can configure git to automatically create a review when a change is pushed.
You can configure Git to automatically create a review when a change is pushed.
`git config remote.origin.push HEAD:refs/for/master`
......@@ -71,15 +73,17 @@ If you configured the default to refs/for/master as described above, simply
`git push`
If HEAD currently points to the branch with the commits you'd like to push. Ideally, you should work in a feature/bug branch for the issue at hand. Then you can do:
If HEAD currently points to the branch with the commits you'd like to push.
Ideally, you should work in a feature/bug branch for the issue at hand. Then you can do:
`git push origin <bugfix_branchname>:refs/for/master`
If this is the first time you've pushed, you will be prompted to install a post-commit Hook to insert a Change-ID in your commit message. Gerrit needs this to track patchsets and will reject pushes until you install it. Simply copy paste the command to install the hook as instructed by Gerrit, and amend your commits.
If this is the first time you've pushed, you will be prompted to install a post-commit hook to insert a Change-ID in your commit message. Gerrit needs this to track patch sets and will reject pushes until you install it.
Simply copy and paste the command to install the hook as instructed by Gerrit and amend your commits.
## To Push a Private patch
## To push a private patch
You can push a work in progress (a.k.a draft) by pushing to refs/for/master%private
You can push a work in progress (a.k.a. draft) by pushing to `refs/for/master%private`.
For instance, you may want a "private" remote to push to; open <project_dir>/.git/config and add:
......@@ -94,4 +98,5 @@ Then:
`git push private`
Private work the same way as patchsets, except they are not visible to others by default and don't trigger any Jenkins builds. A draft can then be shared or published.
Private work the same way as patchsets, except they are not visible to others by default and don't trigger any Jenkins builds.
A draft can then be shared or published.
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment