HACKING: add explanation why we want cool-off times as long as a week or two
[openocd.git] / HACKING
1 NB! If you're behind a corporate wall with http only access to the
2 world, you can still use these instructions!
3
4 Submitting patches to the OpenOCD Gerrit server:
5
6 OpenOCD is to some extent a "self service" open source project, so to
7 contribute, you must follow the standard procedures to have the best
8 possible chance to get your changes accepted.
9
10 The procedure to create a patch is essentially:
11
12 - make the changes
13 - create a commit
14 - send the changes to the Gerrit server for review
15 - correct the patch and re-send it according to review feedback
16
17
18 0. Create a Gerrit account at:
19
20 http://openocd.zylin.com
21
22 - On subsequent sign ins, use the full URL prefaced with 'http://'
23 For example:
24
25 http://user_identifier.open_id_provider.com
26
27 0.1. Add a username to your profile.
28
29 After creating the Gerrit account and signing in, you will need to
30 add a username to your profile. To do this, go to 'Settings', and
31 add a username of your choice.
32
33 Your username will be required in step 2 and substituted wherever
34 the string 'USERNAME' is found.
35
36 0.2. Add an SSH public key
37
38 Following the directions for your specific platform:
39
40 for Windows: help.github.com/win-set-up-git/#_set_up_ssh_keys
41 for OSX: help.github.com/mac-set-up-git/#_set_up_ssh_keys
42 for Linux: help.github.com/linux-set-up-git/#_set_up_ssh_keys
43
44 While these pages describe the setting up of git as well,
45 you should scroll down the page till you get to the section:
46 'Next: Set Up SSH Keys', and follow the steps described.
47
48 1. Clone the git repository, rather than just
49 download the source.
50
51 git clone git://openocd.git.sourceforge.net/gitroot/openocd/openocd
52
53 or if you have problems with the "git:" protocol, use
54 the slower http protocol:
55
56 git clone http://repo.or.cz/r/openocd.git
57
58 2. Set up Gerrit with your local repository. All this does it
59 to instruct git locally how to send off the changes.
60
61 Add a new remote to git using Gerrit username:
62
63 git remote add review ssh://USERNAME@openocd.zylin.com:29418/openocd.git
64 git config remote.review.push HEAD:refs/for/master
65
66 Or with http only:
67
68 git remote add review http://openocd.zylin.com/p/openocd.git
69 git config remote.review.push HEAD:refs/for/master
70
71 You will need to install this hook, we will look into a better
72 solution:
73
74 scp -p -P 29418 USERNAME@openocd.zylin.com:hooks/commit-msg .git/hooks/
75
76 Or with http only:
77
78 wget http://openocd.zylin.com/tools/hooks/commit-msg
79 mv commit-msg .git/hooks
80 chmod +x .git/hooks/commit-msg
81
82 3. Set up git with your name and email:
83
84 git config --global user.name "John Smith"
85 git config --global user.email "john@smith.org"
86
87 4. Work on your patches. Split the work into
88 multiple small patches that can be reviewed and
89 applied seperately and safely to the OpenOCD
90 repository.
91
92 while(!done) {
93 work - edit files using your favorite editor.
94 run "git commit -s -a" to commit all changes.
95 run tools/checkpatch.sh to verify your patch style is ok.
96 }
97
98 TIP! use "git add ." before commit to add new files.
99
100 --- example comment, notice the short first line w/topic ---
101 topic: short comment
102 <blank line>
103 longer comments over several
104 lines...
105 -----
106
107 5. Next you need to make sure that your patches
108 are on top of the latest stuff on the server and
109 that there are no conflicts.
110
111 git pull --rebase origin/master
112
113 6. Send the patches to the Gerrit server for review.
114
115 git push review
116
117 7. Forgot something, want to add more? Just make the changes and do:
118
119 git commit --amend
120 git push review
121
122 Further reading:
123
124 http://www.coreboot.org/Git
125
126
127 When can I expect my contribution to be committed?
128 ==================================================
129
130 The code review is intended to take as long as a week or two to allow
131 maintainers and contributors who work on OpenOCD only in their spare
132 time oportunity to perform a review and raise objections.
133
134 With Gerrit much of the urgency of getting things committed has been
135 removed as the work in progress is safely stored in Gerrit and
136 available if someone needs to build on your work before it is
137 submitted to the official repository.
138
139 Another factor that contributes to the desire for longer cool-off
140 times (the time a patch lies around without any further changes or
141 comments), it means that the chances of quality regression on the
142 master branch will be much reduced.
143
144 If a contributor pushes a patch, it is considered good form if another
145 contributor actually approves and submits that patch.

Linking to existing account procedure

If you already have an account and want to add another login method you MUST first sign in with your existing account and then change URL to read https://review.openocd.org/login/?link to get to this page again but this time it'll work for linking. Thank you.

SSH host keys fingerprints

1024 SHA256:YKx8b7u5ZWdcbp7/4AeXNaqElP49m6QrwfXaqQGJAOk gerrit-code-review@openocd.zylin.com (DSA)
384 SHA256:jHIbSQa4REvwCFG4cq5LBlBLxmxSqelQPem/EXIrxjk gerrit-code-review@openocd.org (ECDSA)
521 SHA256:UAOPYkU9Fjtcao0Ul/Rrlnj/OsQvt+pgdYSZ4jOYdgs gerrit-code-review@openocd.org (ECDSA)
256 SHA256:A13M5QlnozFOvTllybRZH6vm7iSt0XLxbA48yfc2yfY gerrit-code-review@openocd.org (ECDSA)
256 SHA256:spYMBqEYoAOtK7yZBrcwE8ZpYt6b68Cfh9yEVetvbXg gerrit-code-review@openocd.org (ED25519)
+--[ED25519 256]--+
|=..              |
|+o..   .         |
|*.o   . .        |
|+B . . .         |
|Bo. = o S        |
|Oo.+ + =         |
|oB=.* = . o      |
| =+=.+   + E     |
|. .=o   . o      |
+----[SHA256]-----+
2048 SHA256:0Onrb7/PHjpo6iVZ7xQX2riKN83FJ3KGU0TvI0TaFG4 gerrit-code-review@openocd.zylin.com (RSA)