Project

General

Profile

Development git patches » History » Version 13

al, 08/27/2010 01:50 PM

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 12 al
1. Create a git copy of the master from git.quassel-irc.org
12 1 tan
<pre>$ git clone git://git.quassel-irc.org/quassel.git</pre>
13 1 tan
14 12 al
2. Change into your new copy of the git repository
15 1 tan
<pre>$ cd quassel</pre>
16 1 tan
17 12 al
3. Set your personal preferences
18 1 tan
<pre>$ git config --global user.name "Your full name here"
19 1 tan
$ git config --global user.email "your.email@address.here"</pre>
20 3 tan
21 12 al
4. At this point you have your very own working copy of the central git repository which you can make changes to.
22 12 al
<pre>$ ls
23 12 al
AUTHORS    CMakeLists.txt  dev-notes  gpl-2.0.txt  INSTALL     po       src
24 12 al
ChangeLog  COPYING         doc        gpl-3.0.txt  interfaces  README   version.inc
25 12 al
cmake      data            Doxyfile   icons        pics        scripts</pre>
26 1 tan
27 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).
28 1 tan
29 1 tan
h2. Existing setups
30 1 tan
31 1 tan
Here, I assume you have either followed the instructions above, or already have a git repository clone from the master.
32 1 tan
Also, I expect that you are inside the local 'quassel' repository as per 3. in the "First-time setup" above.
33 4 tan
34 1 tan
1. If you want to keep your local repository up to date with the central one, you just need to synchronize
35 4 tan
<pre>$ git pull --rebase</pre>
36 4 tan
37 4 tan
2. After you have done your changes to the file for bug fixing, you can check that the changes are recorded by git
38 11 johu
(all your changes will be shown, press <space> to move one page further, and <q> to stop showing the differences/changes)
39 13 al
<pre>$ git status</pre><pre>$ git diff</pre>
40 1 tan
41 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)
42 7 tan
<pre>$ git add <path-to-file></pre>
43 3 tan
44 4 tan
4. You then commit the changes you have done (which will give some feedback like the one I've provided below)
45 6 tan
(You should change the "Fixed some small inconsistencies" text with some short description of your changes)
46 3 tan
<pre>$ git commit -m "Fixed some small inconsistencies."
47 3 tan
[master edc8b8a] Fixed some small inconsistencies.
48 3 tan
 1 files changed, 8 insertions(+), 9 deletions(-)</pre>
49 3 tan
50 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)
51 1 tan
<pre>$ git status
52 3 tan
# On branch master
53 3 tan
# Your branch is ahead of 'origin/master' by 1 commit.
54 1 tan
#
55 1 tan
nothing to commit (working directory clean)</pre>
56 1 tan
57 4 tan
6. You then create the actual patch-file (note that the name of the file is the description provided in 4. above)
58 4 tan
<pre>$ git format-patch origin/master
59 4 tan
0001-Fixed-some-small-inconsistencies.patch</pre>
60 4 tan
61 4 tan
7. Congratulations! :-) 
62 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.