Trabajar con Gerrit

Account setup

  1. Sign in with your Google, GitHub, or git.jami.net account.

  2. También necesitará [cargar una clave SSH]https://review.jami.net/settings/#SSHKeys) para poder realizar cambios para revisión.

  3. No olvides seleccionar un nombre de usuario.

  4. Finally, the email address specified in your git config must match one of the email addresses registered with your Gerrit account.

Importante

For Savoir-faire Linux Inc. employees: please continue to use your @savoirfairelinux.com email address.

To view your Git config

git config --list

To test your SSH access

To check that your SSH access is properly set up, run the following command:

ssh -p 29420 <nombre de usuario>@review.jami.net

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:

****    Welcome to Gerrit Code Review    ****

Hi, you have successfully connected over SSH.

  Unfortunately, interactive shells are disabled.
  To clone a hosted Git repository, use:

  git clone ssh://<username>@review.jami.net:29420/REPOSITORY_NAME.git

Connection to review.jami.net closed.

Git configuration

Gerrit is the official Git repository.

Para actualizar la configuración

You must update your remote information to now use the Gerrit repository. To do that, update your origin URL:

git remoto de conjunto de url origen ssh://<username>@review.jami.net:29420/<proyecto_nombre>

Replace <project_name> with the correct project (example: jami-daemon).

O clonar el repositorio existente si quieres empezar de nuevo.

Para empujar por defecto en refs/for/master

You can configure Git to automatically create a review when a change is pushed.

git config remoto.orig.push HEAD:refs/for/master

Para crear la revisión

Cuando se empuje a esta rama mágica, se creará automáticamente una revisión sobre Gerrit.

git empujar origen TEMA:refs/for/master

Si configuró el predefinido para refs/for/master como se describe anteriormente, simplemente

git empujar

Si HEAD actualmente apunta a la rama con los compromisos que desea empujar. Idealmente, debe trabajar en una rama de características / errores para el problema en cuestión. Entonces puede hacer:

git origen de empuje <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 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

You can push a work in progress (a.k.a. draft) by pushing to refs/for/master%private.

Por ejemplo, puede que desee un control remoto «privado» para presionar; abra <project_dir>/.git/config y añada:

[remote "private"]

    url = ssh://<username>@review.jami.net:29420/jami-daemon
    push = HEAD:refs/for/master%private

Entonces:

git empujar privado

El trabajo privado es igual que los conjuntos de parches, excepto que no son visibles para otros por defecto y no desencadenan ninguna construcción de Jenkins.