Merge lp:~elementary-pantheon/contractor/hacking into lp:contractor/0.3

Proposed by Danielle Foré
Status: Merged
Approved by: Cody Garver
Approved revision: 138
Merged at revision: 138
Proposed branch: lp:~elementary-pantheon/contractor/hacking
Merge into: lp:contractor/0.3
Diff against target: 185 lines (+181/-0)
1 file modified
HACKING (+181/-0)
To merge this branch: bzr merge lp:~elementary-pantheon/contractor/hacking
Reviewer Review Type Date Requested Status
Contractor Developers Pending
Review via email: mp+286441@code.launchpad.net

Commit message

Add HACKING file

Description of the change

Doesn't look like most of our projects have a README, so just added HACKING

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'HACKING'
2--- HACKING 1970-01-01 00:00:00 +0000
3+++ HACKING 2016-02-18 00:28:49 +0000
4@@ -0,0 +1,181 @@
5+====== Contractor - Contribute ======
6+
7+**This document is licensed under the LGPL 2.1.**
8+This document is based on the HACKING file from the Midori browser project.
9+
10+====== Testing the latest build ======
11+
12+Get daily builds in Launchpad (https://launchpad.net/~elementary-os/+archive/daily ppa:elementary-os/daily).
13+
14+====== Join IRC chat rooms ======
15+
16+Join #elementary-dev on Freenode: https://kiwiirc.com/client/irc.freenode.net/elementary-dev.
17+
18+====== Contribute without touching code ======
19+
20+- http://bugs.launchpad.net/contractor Go through problem reports and check Unconfirmed bugs or those lacking information and mark any duplicates you spot.
21+- https://translations.launchpad.net/contractor Help getting Contractor translated in your language!
22+
23+====== Check out the sources ======
24+
25+ bzr branch lp:contractor
26+
27+The development **trunk** (master, tip) is the latest iteration of the next release.
28+Browse it online and look for other branches at http://code.launchpad.net/contractor
29+
30+====== Build the code ======
31+
32+Refer to INSTALL for required dependencies.
33+
34+Then:
35+
36+ mkdir build
37+ cd build
38+ cmake .. -DCMAKE_INSTALL_PREFIX=/usr
39+ make
40+
41+Run Contractor:
42+ ./contractor
43+
44+To run Contractor from a local branch, you will need to already have Contractor installed in your system, since configuration files are loaded from system directories.
45+
46+If you'd like to install from your local branch:
47+ sudo make install
48+
49+====== Debugging issues ======
50+
51+Testing an installed release may reveal crashers or memory corruption which require investigating from a local build and obtaining a stacktrace (backtrace, crash log).
52+
53+ gdb ./contractor
54+ run --debug
55+
56+====== Coding style and quality ======
57+
58+Be sure to check the official elementary Code Style guide at:
59+ http://elementary.io/docs/code/code-style
60+
61+Contractor's code should in general have:
62+
63+ * 4 space indentation, no tabs.
64+ * Between 80 to 120 columns.
65+ * Prefer /* */ style comments.
66+ * Call variables //animal// and //animal_shelter// instead of <del>camelCase</del>.
67+ * Keep a space between functions/ keywords and round parentheses.
68+
69+ * Prefer //new Gtk.Widget ()// over //using Gtk; new Widget ()//
70+ * No necessity to prefix anything from the GLib namespace. An exception to this rule is when using GOF.File and GLib.File in the same source file.
71+ * Stick to standard Vala-style curly parentheses on the same line
72+ * Cuddled //} else {// and //} catch (Error error) {//
73+
74+====== Important: Keep fixes for different bugs in different branches ======
75+
76+Branches 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.
77+This doesn't apply to patches that are indivisible by nature, and that fix multiple bugs.
78+
79+The reasons to work in this way are the following:
80+
81+ * 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.
82+ * 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.
83+
84+Be sure to understand this, and avoid a headache later!
85+
86+====== Committing code ======
87+
88+Make a branch which will contain your changes for fixing bug XXXX:
89+
90+ bzr branch lp:contractor fix-XXXX
91+
92+Tell Bazaar your name if you haven't yet:
93+
94+ bzr whoami "Real Name <email@address>"
95+
96+See what you did so far:
97+
98+ bzr diff
99+ bzr diff | colordiff
100+
101+Get an overview of changed and new files:
102+
103+ bzr status
104+
105+Add new files, move/ rename or delete:
106+
107+ bzr add FILENAME
108+ bzr mv OLDFILE NEWFILE
109+ bzr rm FILENAME
110+
111+After making your changes, you need to commit your work as a new revision.
112+
113+ bzr commit -m "Commit message"
114+
115+Commit your changes in small increments. It is better to keep different changes in different commits.
116+
117+To see the last 5 revisions in the current branch:
118+
119+ bzr log -l5
120+ bzr log -l5 -p | less
121+
122+In the case you committed something wrong or want to ammend it:
123+
124+ bzr uncommit
125+
126+If you want to revert all the changes made after the last revision:
127+ bzr revert
128+
129+Remember to keep your branch updated:
130+
131+ bzr pull
132+
133+As a general rule of thumb, ''bzr help COMMAND'' gives you an explanation of any command and ''bzr help commands'' lists all available commands.
134+
135+//If you're a die-hard git user, http://zyga.github.io/git-lp/ checkout git-lp to use git commands with the Bazaar repository.//
136+
137+====== Push proposed changes ======
138+
139+If 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.
140+
141+If 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.
142+
143+ bzr push lp:~USERNAME/contractor/fix-123456
144+ bzr lp-open
145+
146+The 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.
147+Your 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!
148+After the branch is approved by the reviewer, it will get merged into the main project's source code.
149+
150+
151+**What happens to all the branches?**
152+
153+Leave the branches alone, **approved branches are cleared automatically** by Launchpad.
154+
155+For larger feature branches, **use the team** in Launchpad to allow other developers to work on the code with you.
156+
157+
158+What if I want to help out on an **existing merge request** that I can't push to?
159+
160+ bzr branch ~OTHERPERSON/contractor/fix-123456
161+ cd fix-123456
162+ # make commits
163+ bzr push lp:USERNAME~/contractor/fix-123456
164+ bzr lp-open
165+
166+And in the Launchpad web overview of your branch, propose your branch for merging into ~OTHERPERSON/contractor/fix-123456
167+
168+
169+Updating a branch that may be out of sync with trunk:
170+
171+ bzr pull
172+ bzr: ERROR: These branches have diverged
173+ bzr merge lp:contractor
174+ # Hand-edit conflicting changes
175+ bzr resolve FILENAME
176+ # If any conflicts remain continue fixing
177+ bzr commit -m 'Merge changes from lp:contractor'
178+
179+
180+Save a little bandwidth, **branch from an existing local copy** that you keep around:
181+
182+ bzr branch lp:contractor contractor
183+ bzr branch contractor fix-123456
184+ cd fix-123456
185+ bzr pull lp:contractor

Subscribers

People subscribed via source and target branches