target: make it absolutely clear that no null pointers are accepted
[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 }
96
97 TIP! use "git add ." before commit to add new files.
98
99 --- example comment, notice the short first line w/topic ---
100 topic: short comment
101 <blank line>
102 longer comments over several
103 lines...
104 -----
105
106 5. Next you need to make sure that your patches
107 are on top of the latest stuff on the server and
108 that there are no conflicts.
109
110 git pull --rebase origin/master
111
112 6. Send the patches to the Gerrit server for review.
113
114 git push review
115
116 7. Forgot something, want to add more? Just make the changes and do:
117
118 git commit --amend
119 git push review
120
121 Further reading:
122
123 http://www.coreboot.org/Git

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)