Merge lp:~junrrein/granite/developer-documentation into lp:~elementary-pantheon/granite/granite

Proposed by Julián Unrrein
Status: Merged
Approved by: xapantu
Approved revision: 608
Merged at revision: 863
Proposed branch: lp:~junrrein/granite/developer-documentation
Merge into: lp:~elementary-pantheon/granite/granite
Diff against target: 147 lines (+143/-0)
1 file modified
HACKING (+143/-0)
To merge this branch: bzr merge lp:~junrrein/granite/developer-documentation
Reviewer Review Type Date Requested Status
xapantu (community) Approve
David Gomes Pending
Review via email: mp+180705@code.launchpad.net

Commit message

Add developer documentation.

Description of the change

Add developer documentation about how to contribute to Granite.

To post a comment you must log in.
608. By Julián Unrrein

Include option to generate debug symbols in configuration step.

Revision history for this message
David Gomes (davidgomes) wrote :

Claimed the review, I got this for tomorrow.

Revision history for this message
xapantu (xapantu) wrote :

That would be better if it was a normal markdown file, but still, that's an improvement. Thanks :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== added file 'HACKING'
--- HACKING 1970-01-01 00:00:00 +0000
+++ HACKING 2013-08-17 21:42:16 +0000
@@ -0,0 +1,143 @@
1====== Granite - Contribute ======
2
3This document is licensed under the LGPL 2.1.
4
5====== Testing the latest build ======
6
7Get daily builds in Launchpad (https://launchpad.net/~elementary-os/+archive/daily ppa:elementary-os/daily).
8
9====== Join IRC chat rooms ======
10
11Join #elementary-dev on Freenode: https://kiwiirc.com/client/irc.freenode.net/elementary-dev.
12
13====== Contribute without touching code ======
14
15- http://bugs.launchpad.net/granite Go through problem reports and check Unconfirmed bugs or those lacking information and mark any duplicates you spot.
16- https://translations.launchpad.net/granite Help getting Granite translated in your language!
17
18====== Check out the sources ======
19
20 bzr branch lp:granite
21
22The development trunk (master, tip) is the latest iteration of the next release.
23Browse it online and look for other branches at http://code.launchpad.net/granite
24
25====== Build the code ======
26
27 mkdir build
28 cd build
29 cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug ..
30 make
31
32Run a program using your compiled Granite branch:
33 LD_LIBRARY_PATH=/home/USERNAME/granite/build/lib program
34
35To compile a program using your compiled Granite branch, you will need to install it:
36 sudo make install
37
38====== Coding style and quality ======
39
40Check the official elementary Code Style guide at:
41 http://elementaryos.org/docs/code/code-style
42
43====== Important: Keep fixes for different bugs in different branches ======
44
45Branches that contain patches to fix more than one bug will be rejected, and you will be asked to supply a separate branch for every bug fix.
46This doesn't apply to patches that are indivisible by nature, and that fix multiple bugs.
47
48The reasons to work in this way are the following:
49
50 * If one of the bugs targeted by your branch is correctly fixed, but one of the other bugs is incorrectly fixed or needs corrections, the branch won't be accepted until everything looks ok for all bugs. This causes an unnecessary delay for the bugs that where fixed correctly.
51 * Suppose your branch was accepted for merging in the main one. Later, it is discovered that your branch introduces faulty behavior. The standard course of action for these situations is to revert the merge that introduced that faulty behavior. This will cause that all of your fixes are reverted (even the ones that didn't cause problems) because there was no way of discriminating between them. If a separate branch for each bug fixed existed, only the offending one would have been reverted, and not all of them.
52
53Be sure to understand this, and avoid a headache later!
54
55====== Committing code ======
56
57Make a branch which will contain your changes for fixing bug XXXX:
58 bzr branch lp:granite fix-XXXX
59
60Tell Bazaar your name if you haven't yet:
61 bzr whoami "Real Name <email@address>"
62
63See what you did so far:
64 bzr diff
65 bzr diff | colordiff
66
67Get an overview of changed and new files:
68 bzr status
69
70Add new files, move/ rename or delete:
71 bzr add FILENAME
72 bzr mv OLDFILE NEWFILE
73 bzr rm FILENAME
74
75After making your changes, you need to commit your work as a new revision.
76 bzr commit -m "Commit message"
77
78Commit your changes in small increments. It is better to keep different changes in different commits.
79
80To see the last 5 revisions in the current branch:
81 bzr log -l5
82 bzr log -l5 -p | less
83
84In the case you committed something wrong or want to ammend it:
85 bzr uncommit
86
87If you want to revert all the changes made after the last revision:
88 bzr revert
89
90Remember to keep your branch updated:
91 bzr pull
92
93As a general rule of thumb, ''bzr help COMMAND'' gives you an explanation of any command and ''bzr help commands'' lists all available commands.
94
95====== Push proposed changes ======
96
97If you haven't yet, https://launchpad.net/~/+editsshkeys check that Launchpad has your SSH key - you can create an SSH key with Passwords and Keys aka Seahorse or ''ssh-keygen -t rsa'' - and use ''bzr launchpad-login'' to make youself known to bzr locally.
98
99If you checked out trunk, and added your patch(es), just push it under your username in Launchpad and you can propose it for merging into trunk. This will automatically request a review from other developers who can then comment on it and provide feedback.
100
101 bzr push lp:~USERNAME/granite/fix-123456
102 bzr lp-open
103
104The last command will open a summary of the current branch in your web browser. There, you will be able to propose it for merging into trunk.
105Your branch will be reviewed by another developer. At this stage, you may be notified that changes need to be made to your branch, so keep an eye on your email inbox!
106After the branch is approved by the reviewer, it will get merged into the main project's source code.
107
108
109What happens to all the branches?
110
111Leave the branches alone, approved branches are cleared automatically by Launchpad.
112
113For larger feature branches, use the team in Launchpad to allow other developers to work on the code with you.
114
115
116What if I want to help out on an existing merge request that I can't push to?
117
118 bzr branch ~OTHERPERSON/granite/fix-123456
119 cd fix-123456
120 # make commits
121 bzr push lp:USERNAME~/midori/fix-123456
122 bzr lp-open
123
124And in the Launchpad web overview of your branch, propose your branch for merging into ~OTHERPERSON/granite/fix-123456
125
126
127Updating a branch that may be out of sync with trunk:
128
129 bzr pull
130 bzr: ERROR: These branches have diverged
131 bzr merge lp:granite
132 # Hand-edit conflicting changes
133 bzr resolve FILENAME
134 # If any conflicts remain continue fixing
135 bzr commit -m 'Merge changes from lp:granite'
136
137
138Save a little bandwidth, branch from an existing local copy that you keep around:
139
140 bzr branch lp:granite granite
141 bzr branch granite/ granite-fix-123456
142 cd granite-fix-123456
143 bzr pull lp:granite

Subscribers

People subscribed via source and target branches