Lavorare con Gerrit
Account setup
Servidore Gerrit: https://review.jami.net
Documentazione dell’utente: https://review.jami.net/Documentazione/intro-user.html
Progetti Jami su Gerrit: https://review.jami.net/admin/repos/
Sign in with your Google, GitHub, or git.jami.net account.
Dovrai anche [caricare una chiave SSH]https://review.jami.net/settings/#SSHKeys) per poter effettuare modifiche per la revisione.
Non dimenticare di selezionare un nome utente.
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 <nome utente>@review.jami.net
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.
Per aggiornare la configurazione
You must update your remote information to now use the Gerrit repository. To do that, update your origin URL:
git set-url origin ssh://<username>@review.jami.net:29420/<project_name>
Replace <project_name>
with the correct project (example: jami-daemon).
O clona il repository esistente se vuoi ricominciare da capo.
Per spingere per impostazione predefinita in 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
Per creare la revisione
Quando si spinge a questo ramo magico, verrà creata automaticamente una recensione su Gerrit.
git spingere origine TESTO:refs/for/master
Se hai configurato il default a refs/for/master come descritto sopra, basta
git spingere
Se HEAD attualmente punta alla branca con i commit che vorresti spingere. Idealmente, dovresti lavorare in una branca di funzionalità / bug per il problema in questione.
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 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
.
Ad esempio, si può desiderare un telecomando «privato» da spingere; aprire <project_dir>/.git/config e aggiungere:
[remote "private"]
url = ssh://<username>@review.jami.net:29420/jami-daemon
push = HEAD:refs/for/master%private
Allora:
git spingere privato
La funzione privata è identica a quella dei patch set, solo che non sono visibili per altri e non attivano alcuna costruzione di Jenkins.