Travailler avec Gerrit

Account setup

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

  2. Vous devrez également [ télécharger une clé SSH]https://review.jami.net/settings/#SSHKeys) pour pouvoir effectuer des modifications pour examen.

  3. N’oubliez pas de sélectionner un nom d’utilisateur.

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

Important

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 <nom d'utilisateur>@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.

Pour mettre à jour la configuration

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

git fichier url à distance ssh://<username>@review.jami.net:29420/<projet_name>

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

Ou cloner le référentiel existant si vous voulez recommencer.

Pour pousser par défaut dans les références/pour/maître

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

git configurer le télécommandeur. origine. poussée Tête:refs/for/master

Pour créer le révision

Quand vous arrivez à cette branche magique, une revue sera automatiquement créée sur Gerrit.

`git source de poussée Tête:refs/for/master

Si vous avez configuré la configuration par défaut à refs/for/master comme décrit ci-dessus, vous pouvez simplement

Je suis en train de me faire pousser.

Si HEAD pointe actuellement vers la branche avec les commits que vous souhaitez pousser. Idéalement, vous devriez travailler dans une branche fonctionnalité / bug pour le problème en question.

git source de mise en place <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.

Par exemple, vous pouvez utiliser une télécommande « privée » pour appuyer sur; ouvrir <project_dir>/.git/config et ajouter:

[remote "private"]

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

Alors:

git pousser privé

Les travaux privés sont similaires aux patchets, mais ils ne sont pas visibles par défaut et ne déclenchent pas de constructions Jenkins.