Arbejde med Gerrit
Account setup
Gerrit server: https://review.jami.net
Brugerdokumentation: https://review.jami.net/Documentation/intro-user.html
Jami-projekter på Gerrit: https://review.jami.net/admin/repos/
Sign in with your Google, GitHub, or git.jami.net account.
Du skal også [oplade en SSH-nøgle]https://review.jami.net/settings/#SSHKeys) for at kunne foretage ændringer til revision.
Glem ikke at vælge et brugernavn.
Finally, the email address specified in your git config must match one of the email addresses registered with your Gerrit account.
Vigtigt
For Savoir-faire Linux Inc. employees: please continue to use your @savoirfairelinux.com email address.
To view your Git config
git konfiguration --list
To test your SSH access
To check that your SSH access is properly set up, run the following command:
ssh -p 29420 <brugernavn>@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.
For at opdatere konfigurationen
You must update your remote information to now use the Gerrit repository. To do that, update your origin URL:
git fjern-url-oprigthed ssh://<brugernavn>@review.jami.net:29420/<projekt_navn>
Replace <project_name>
with the correct project (example: jami-daemon).
Eller klonere det eksisterende arkiv, hvis du vil starte fra begyndelsen.
For at skubbe ved standard i refs/for/master
You can configure Git to automatically create a review when a change is pushed.
git konfigurere remote.origin.push HEAD:refs/for/master
For at skabe en gennemgang
Når man går til denne magiske gren, bliver der automatisk lavet en anmeldelse af Gerrit.
git skub origin HEAD:refs/for/master
Hvis du har konfigureret standarden til refs/for/master som beskrevet ovenfor, kan du blot
git skubbe
Hvis HEAD i øjeblikket peger på den gren med de commits du ønsker at skubbe. ideelt set, bør du arbejde i en funktion / bug gren til problemet i hånden.
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
.
For eksempel kan du have brug for en »privat« fjernkontroll at trykke på; åbne <project_dir>/.git/config og tilføje:
[remote "private"]
url = ssh://<username>@review.jami.net:29420/jami-daemon
push = HEAD:refs/for/master%private
Så:
git skubbe privat
Private arbejder på samme måde som patchsetter, men de er ikke synlige for andre som standard og udløser ikke nogen Jenkins-bygninger.