Project

General

Profile

Development git patches » History » Version 11

johu, 08/27/2010 01:32 PM
removed translation stuff

1 11 johu
h1. Git Patches
2 1 tan
3 9 tan
{{toc}}
4 9 tan
5 1 tan
h2. About these instructions
6 1 tan
7 1 tan
There are two sets of instructions here; one for first-time setup, one for already existing setups.
8 1 tan
9 1 tan
h2. First-time setup
10 1 tan
11 1 tan
1. Create a directory to hold the git repository
12 1 tan
<pre>$ mkdir quassel-dev
13 1 tan
$ cd quassel-dev</pre>
14 1 tan
15 1 tan
2. Create a git copy of the master from git.quassel-irc.org
16 1 tan
<pre>$ git clone git://git.quassel-irc.org/quassel.git</pre>
17 1 tan
18 1 tan
3. Change into your new copy of the git repository
19 1 tan
<pre>$ cd quassel</pre>
20 1 tan
21 3 tan
4. Set your personal preferences
22 3 tan
<pre>$ git config --global user.name "Your full name here"
23 3 tan
$ git config --global user.email "your.email@address.here"</pre>
24 1 tan
25 11 johu
5. At this point you have your very own working copy of the central git repository which you can make changes to. Now is a good time to fix the bug (you should edit the file in your local git repository).
26 11 johu
As an example based on bug fix in core irc server handler: <pre>~/quassel-dev/quassel/src/core/ircserverhandler.cpp</pre>
27 1 tan
28 2 tan
When you have edited the file(s), you should follow the steps in the "Existing setups" below to create the git patch file(s).
29 1 tan
30 1 tan
h2. Existing setups
31 1 tan
32 1 tan
Here, I assume you have either followed the instructions above, or already have a git repository clone from the master.
33 4 tan
Also, I expect that you are inside the local 'quassel' repository as per 3. in the "First-time setup" above.
34 1 tan
35 4 tan
1. If you want to keep your local repository up to date with the central one, you just need to synchronize
36 4 tan
<pre>$ git pull --rebase</pre>
37 4 tan
38 11 johu
2. After you have done your changes to the file for bug fixing, you can check that the changes are recorded by git
39 1 tan
(all your changes will be shown, press <space> to move one page further, and <q> to stop showing the differences/changes)
40 3 tan
<pre>$ git diff</pre>
41 1 tan
42 11 johu
3. Then it's time to add your changes to the local index (change <path-to-file> with complete path to your changed file)
43 7 tan
<pre>$ git add <path-to-file></pre>
44 3 tan
45 4 tan
4. You then commit the changes you have done (which will give some feedback like the one I've provided below)
46 6 tan
(You should change the "Fixed some small inconsistencies" text with some short description of your changes)
47 3 tan
<pre>$ git commit -m "Fixed some small inconsistencies."
48 3 tan
[master edc8b8a] Fixed some small inconsistencies.
49 3 tan
 1 files changed, 8 insertions(+), 9 deletions(-)</pre>
50 3 tan
51 4 tan
5. You can now check the status of you git repository (which will give some feedback like the one I've provided below)
52 1 tan
<pre>$ git status
53 3 tan
# On branch master
54 3 tan
# Your branch is ahead of 'origin/master' by 1 commit.
55 1 tan
#
56 1 tan
nothing to commit (working directory clean)</pre>
57 1 tan
58 4 tan
6. You then create the actual patch-file (note that the name of the file is the description provided in 4. above)
59 4 tan
<pre>$ git format-patch origin/master
60 4 tan
0001-Fixed-some-small-inconsistencies.patch</pre>
61 4 tan
62 4 tan
7. Congratulations! :-) 
63 11 johu
This file is now ready and you attach to the bug issue or send it to a developer via mail e.g. devel _at_ quassel-irc.org.