HACKING: add tip on how to write comments
[fw/openocd] / HACKING
1 Submitting patches to the OpenOCD mailing list:
2
3 By the time you have read this, one supposes that 
4 you have figured out how to clone the OpenOCD git
5 repository.
6
7 Below is a basic workflow and specific instructions 
8 to get you going with git and patches.
9
10 0. Clone the git repository, rather than just
11 download the source. 
12
13 git clone git://openocd.git.sourceforge.net/gitroot/openocd/openocd
14
15 or if you have problems with the "git:" protocol, use
16 the slower http protocol:
17
18 git clone http://repo.or.cz/r/openocd.git
19
20 1. Set up git with your name and email:
21
22 git config --global user.name "John Smith"
23 git config --global user.email "john@smith.org"
24
25 2. Work on your patches. Split the work into 
26 multiple small patches that can be reviewed and
27 applied seperately and safely to the OpenOCD
28 repository.
29
30 while(!done) {
31   work - edit files using your favorite editor.
32   run "git commit -a" to commit all changes. 
33 }
34
35 TIP! use "git add ." before commit to add new files.
36
37 --- example comment, notice the short first line w/topic ---
38 topic: short comment
39 <blank line>
40 longer comments over several
41 lines...
42 -----
43
44 3. Next you need to make sure that your patches
45 are on top of the latest stuff on the server and
46 that there are no conflicts.
47
48 git pull --rebase
49
50 4. Generate the patch files. This will generate
51 patches for all commits that are on top of
52 the latest stuff on the server:
53
54 git format-patch origin/master
55
56 5. Email the patches to openocd-development@lists.berlios.de