Lucrând cu Gerrit

Account setup

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

  2. De asemenea, va trebui să [cargați o cheie SSH]https://review.jami.net/settings/#SSHKeys) pentru a putea comite modificări pentru revizuire.

  3. Nu uita să selectezi un nume de utilizator.

  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 <username>@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.

Pentru a actualiza configurația

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

git set-url de origine ssh://<username>@review.jami.net:29420/<proiect_name>

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

Sau clona reţinutul existent dacă vrei să începi din nou.

Pentru a împinge prin default în refs/for/master

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

git config remote.origin.push HEAD:refs/for/master

Pentru a crea o revizuire

Când împingi la această ramură magică, o revizuire va fi creată automat pe Gerrit.

git împinge originea TĂRĂR:refs/for/master

Dacă ați configurat standardul pentru refs/for/master, așa cum este descris mai sus, pur și simplu

git împinge

Dacă HEAD arată în prezent la ramura cu comiturile pe care doriți să le împingeți. Ideal, ar trebui să lucrați într-o ramură de caracteristici/bug pentru problema în cauză.

git origine <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.

De exemplu, puteți dori să apăsați pe un telecomandă „privat”; deschideți <project_dir>/.git/config și adăugați:

[remote "private"]

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

Apoi:

git împinge privat

Lucrarea privată este la fel ca și seturile de patch, cu excepția faptului că acestea nu sunt vizibile altora prin default și nu declanșează nici un construcții Jenkins.