~elementary-apps/pantheon-files/trunk

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