how-to-submit-a-patch.md (1928B)
1 # How to Submit a Patch 2 3 These are the steps 4 5 ## Setting up git and ssh 6 7 (**to work smoothly with Gerrit.**) 8 9 10 first see: 11 12 * [Creating a gerrit review](https://git.jami.net/savoirfairelinux/ring-project/wikis/tutorials/Working-with-gerrit#to-create-the-review) 13 14 ## SSH setup 15 16 https://review.jami.net/Documentation/user-upload.html#ssh 17 18 1. Generate a personal dedicated public / private key set. 19 ```bash 20 ssh-keygen -t rsa -f ~/.ssh/jami_gerrit_review_rsa` 21 ``` 22 23 Your identification has been saved in `jami_gerrit_review_rsa`. Your public key has been saved in `jami_gerrit_review_rsa.pub.` 24 25 26 2. Tell gerrit your public key 27 1. Login to [gerrit](https://review.jami.net) via your Gitlab account (Sign-in=>OAuth Gitlab) 28 2. Follow the ssh key instructions found from (your) user options [settings](https://review.jami.net/settings/) 29 30 3. Set up your local ssh (via `ssh-add` or in `~/.ssh/config`) 31 4. Test all of the above (ssh on the service or just try to clone a repo on gerrit via ssh) 32 33 34 ## Your Repository 35 36 This *assumes* you have moved any existing project clone out of the way. 37 38 1. Clone a (fresh) copy of the project. `git clone ssh://USERNAME@review.jami.net:29420/PROJECT_NAME_GOES_HERE.git` eg `git clone ssh://foo@review.jami.net:29420/ring_project.git`. 39 2. Configure this clones local .git/config (optional) 40 3. Generate commit Change-Ids 41 aka: commit-msg hook script 42 43 A shell script, to be installed to .git/hooks/commit-msg. 44 45 46 The script creates a unique Change_Id:hash for each commit made from your repository. 47 48 49 - The first time you attempt a _push_ to review `git push origin HEAD:refs/for/master`, 50 gerrit will notice a lack of Change-Id. 51 52 - Gerrit will also present a secure copy (scp) string. 53 Use *that* to download a copy of .git/hooks/commit-msg. 54 55 56 References 57 ---------- 58 59 + [Some Gritty Details](https://review.jami.net/Documentation/user-upload.html#_gritty_details) 60 61 62 63 Original author: *Peter Gossner*