לעבוד עם גרריט
Account setup
שרת גריט: https://review.jami.net
מסמך משתמש: https://review.jami.net/Documentation/intro-user.html
פרויקטים של ג’אמי על ג’ריט: https://review.jami.net/admin/repos/
Sign in with your Google, GitHub, or git.jami.net account.
אתה גם צריך [להעלות מפתח SSH]https://review.jami.net/settings/#SSHKeys) כדי להיות מסוגל לבצע שינויים לשיקון.
אל תשכח לבחור שם משתמש.
Finally, the email address specified in your git config must match one of the email addresses registered with your Gerrit account.
חשוב
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 <שם משתמש>@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.
כדי לעדכן את ההסדר
You must update your remote information to now use the Gerrit repository. To do that, update your origin URL:
git ממוקד מרחוק-url מקור ssh://<username>@review.jami.net:29420/<project_name>
Replace <project_name>
with the correct project (example: jami-daemon).
או לגלגל את המלאי הקיימים אם אתה רוצה להתחיל מחדש.
לדחוף לפי דפוס ב-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
כדי ליצור את החקירה
כאשר דוחף לשני הקסם הזה, סקירה ייצרו אוטומטית על גריט.
git דחוף מקור HEAD:refs/for/master
אם הפקנתם את ההגדרה כ-refs/for/master כפי שתיאר לעיל, פשוט
git דוחק
אם HEAD מצביע כעת על הסניף עם הקשרים שאתה רוצה לדחוף. באופן אידיאלי, אתה צריך לעבוד בסניף תכונות/שגיעות עבור הבעיה הנשאלת. אז אתה יכול לעשות:
git דחוף מקור <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
.
לדוגמה, ייתכן שתצטרך לחץ על מרחק מרחוק ”פרטי“; לפתוח <project_dir>/.git/config ולהוסיף:
[remote "private"]
url = ssh://<username>@review.jami.net:29420/jami-daemon
push = HEAD:refs/for/master%private
אז:
git דוחף פרטי
עבודה פרטית באותה דרך כמו ערכות פטש, למעט שהם אינם נראים לאחרים בדפוס ולא מפעילים כל בנייה של ג’נקינס.