stlink: handle wrong initialization file if no layout was specified
[openocd.git] / HACKING
blobed971715406b79db363d395920915294ed7dfcc8
1 NB! If you're behind a corporate wall with http only access to the
2 world, you can still use these instructions!
4 Submitting patches to the OpenOCD Gerrit server:
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.
10 The procedure to create a patch is essentially:
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
18 0. Create a Gerrit account at:
20 http://openocd.zylin.com
22 - On subsequent sign ins, use the full URL prefaced with 'http://'
23   For example:
25         http://user_identifier.open_id_provider.com
27 0.1. Add a username to your profile.
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.
33 Your username will be required in step 2 and substituted wherever
34 the string 'USERNAME' is found.
36 0.2. Add an SSH public key
38 Following the directions for your specific platform:
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
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.
48 1. Clone the git repository, rather than just
49 download the source.
51 git clone git://openocd.git.sourceforge.net/gitroot/openocd/openocd
53 or if you have problems with the "git:" protocol, use
54 the slower http protocol:
56 git clone http://repo.or.cz/r/openocd.git
58 2. Set up Gerrit with your local repository. All this does it
59 to instruct git locally how to send off the changes.
61 Add a new remote to git using Gerrit username:
63 git remote add review ssh://USERNAME@openocd.zylin.com:29418/openocd.git
64 git config remote.review.push HEAD:refs/for/master
66 Or with http only:
68 git remote add review http://openocd.zylin.com/p/openocd.git
69 git config remote.review.push HEAD:refs/for/master
71 You will need to install this hook, we will look into a better
72 solution:
74 scp -p -P 29418 USERNAME@openocd.zylin.com:hooks/commit-msg .git/hooks/
76 Or with http only:
78 wget http://openocd.zylin.com/tools/hooks/commit-msg
79 mv commit-msg .git/hooks
80 chmod +x .git/hooks/commit-msg
82 3. Set up git with your name and email:
84 git config --global user.name "John Smith"
85 git config --global user.email "john@smith.org"
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.
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.
98 TIP! use "git add ." before commit to add new files.
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 -----
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.
111 git pull --rebase origin/master
113 6. Send the patches to the Gerrit server for review.
115 git push review
117 7. Forgot something, want to add more? Just make the changes and do:
119 git commit --amend
120 git push review
122 Further reading:
124 http://www.coreboot.org/Git
127 When can I expect my contribution to be committed?
128 ==================================================
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.
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.
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.
144 If a contributor pushes a patch, it is considered good form if another
145 contributor actually approves and submits that patch.