1 # Contribution guidelines
\r
3 You're welcome to contribute to this project! There are several aspects you can help on:
\r
5 - improving our documentation (see [doc/readme.txt](doc/readme.txt) file and [doc](doc) folder),
\r
7 - testing preview releases,
\r
8 - helping other users on the mailing lists,
\r
9 - improving our UIs, or also
\r
10 - coding (e.g., fix open issues or implement new features; see below for more information).
\r
11 - Building TortoiseGit normally is not necessary, however, it is easy. All necessary requirements and steps are described in the [build.txt](build.txt) file. Helpful might also be our short description in the [architecture.txt](architecture.txt) file.
\r
13 Any help is appreciated!
\r
15 Please also see https://tortoisegit.org/contribute/!
\r
17 ## Short version for the impatient
\r
21 - open an issue on https://tortoisegit.org/issues or go to an
\r
22 issue you want to fix. Then you have the following options:
\r
23 - open a GitLab merge request and put the link into the issue
\r
24 - open a GitHub pull request and put the link into the issue
\r
25 - attach a patch there
\r
26 - provide a link to a branch you want the maintainers to pull from
\r
28 For existing issues it is recommended to discuss possible solutions on the issue
\r
29 before you start coding.
\r
33 - make commits of (small) logical units
\r
34 - do not check in commented out code, unrelated changes or unneeded files
\r
35 - the subject (first line of the commit message) should be a short
\r
36 description and should skip the full stop. If it is about a bug
\r
37 report/issue, use `Fixed issue #NUMBER: ISSUE'S TITLE`
\r
38 - the second line of commit message should be an empty line
\r
39 - the body which starts from the third line should provide a meaningful
\r
41 - consier writing a unit test
\r
42 - add a `Signed-off-by: Your Name <you@example.com>` line to the commit
\r
43 message to confirm that you agree to the Developer's Certificate of
\r
45 Please use your real name.
\r
49 - based on Visual Studio default coding style (try to copy & paste)
\r
50 - the old code migrates to new coding style only when modifying it.
\r
51 - variable definitions (as it is a type definition; e.g., CGitHash* name
\r
53 - for `if`, `for`, `while` a spaces between the keyword and the
\r
54 parenthesis (e.g., if ()).
\r
55 - braces go on the next line for `if`, `for`, `else`, ...
\r
56 - If an `if` contains only one action, no braces needed.
\r
57 - function calls, there is no space before the parenthesis (e.g, method()).
\r
58 - no spaces before and after parentheses (e.g., (something)).
\r
59 - spaces between &&, + and other operands also after comma(,).
\r
60 - no variable shadowing.
\r
61 - for variable names: we don't have a strict rule here, should be speak
\r
63 - try not to nest too deeply and return as early as possible.
\r
64 - Only use `this` if needed.
\r
68 ### (0) Make separate commits for logically separate changes.
\r
70 Unless your patch is really trivial, you should not be sending
\r
71 out a patch that was generated between your working tree and
\r
72 your commit head. Instead, always make a commit with complete
\r
73 commit message and generate a series of patches from your
\r
76 Give an explanation for the change(s) that is detailed enough so
\r
77 that people can judge if it is good thing to do, without reading
\r
78 the actual patch text to determine how well the code does what
\r
79 the explanation promises to do.
\r
81 If your description starts to get too long, that's a sign that you
\r
82 probably need to split up your commit to finer grained pieces.
\r
83 That being said, patches which plainly describe the things that
\r
84 help reviewers check the patch, and future maintainers understand
\r
85 the code, are the most beautiful patches. Descriptions that summarise
\r
86 the point in the subject well, and describe the motivation for the
\r
87 change, the approach taken by the change, and if relevant how this
\r
88 differs substantially from the prior version, are all good things
\r
91 Oh, another thing. We are picky about whitespaces. To help ensure this
\r
92 does not happen, run `git diff --check` on your changes before you commit.
\r
94 ### (1a) Create a merge/pull request
\r
96 Push your changes to a public repository. Use a brief branch name
\r
97 describing your changes.
\r
99 Please make sure your pull request does not include any extra files
\r
100 which do not belong in a submission. Make sure to review your patch
\r
101 after generating it, to ensure accuracy.
\r
103 Create a GitLab merge request (https://gitlab.com/tortoisegit/tortoisegit/),
\r
104 a GitHub pull request (https://github.com/TortoiseGit), or use the URL and
\r
105 branchname of the changes in your repository.
\r
107 ### (1b) Generate your patch using git tools out of your commits (Patch serial)
\r
109 git based diff tools generate unified diff which is the preferred format.
\r
111 Please make sure your patch does not include any extra files
\r
112 which do not belong in a patch submission. Make sure to review
\r
113 your patch after generating it, to ensure accuracy. Before
\r
114 sending out, please make sure it cleanly applies to the "master"
\r
117 ### (2) Sign your work
\r
119 To improve tracking of who did what, we've borrowed the
\r
120 "sign-off" procedure from the Linux kernel project on patches
\r
121 that are being emailed around. Although TortoiseGit is a lot
\r
122 smaller project it is a good discipline to follow it.
\r
124 The sign-off is a simple line at the end of the explanation for
\r
125 the patch, which certifies that you wrote it or otherwise have
\r
126 the right to pass it on as a open-source patch. The rules are
\r
127 pretty simple: if you can certify the below:
\r
129 Developer's Certificate of Origin 1.1
\r
131 By making a contribution to this project, I certify that:
\r
133 (a) The contribution was created in whole or in part by me and I
\r
134 have the right to submit it under the open source license
\r
135 indicated in the file; or
\r
137 (b) The contribution is based upon previous work that, to the best
\r
138 of my knowledge, is covered under an appropriate open source
\r
139 license and I have the right under that license to submit that
\r
140 work with modifications, whether created in whole or in part
\r
141 by me, under the same open source license (unless I am
\r
142 permitted to submit under a different license), as indicated
\r
145 (c) The contribution was provided directly to me by some other
\r
146 person who certified (a), (b) or (c) and I have not modified
\r
149 (d) I understand and agree that this project and the contribution
\r
150 are public and that a record of the contribution (including all
\r
151 personal information I submit with it, including my sign-off) is
\r
152 maintained indefinitely and may be redistributed consistent with
\r
153 this project or the open source license(s) involved.
\r
155 then you just add a line saying
\r
157 Signed-off-by: Random J Developer <random@developer.example.org>
\r
159 This line can be automatically added by Git and TortoiseGit.
\r
161 Also notice that a real name is used in the Signed-off-by: line. Please
\r
162 don't hide your real name.
\r
164 If you like, you can put extra tags at the end:
\r
166 1. "Reported-by:" is used to credit someone who found the bug that
\r
167 the patch attempts to fix.
\r
168 2. "Acked-by:" says that the person who is more familiar with the area
\r
169 the patch attempts to modify liked the patch.
\r
170 3. "Reviewed-by:", unlike the other tags, can only be offered by the
\r
171 reviewer and means that s/he is completely satisfied that the patch
\r
172 is ready for application. It is usually offered only after a
\r
174 4. "Tested-by:" is used to indicate that the person applied the patch
\r
175 and found it to have the desired effect.
\r
177 You can also create your own tag or use one that's in common usage
\r
178 such as "Thanks-to:", "Based-on-patch-by:", or "Mentored-by:".
\r
180 ## An ideal patch flow
\r
182 Here is an ideal patch flow for this project the current maintainer
\r
183 suggests to the contributors:
\r
185 0. You come up with an itch. You code it up.
\r
186 For existing issues it is recommended to discuss possible solutions on
\r
187 the issue before you start coding.
\r
189 1. Open an issue on https://tortoisegit.org/issues or create a merge/pull
\r
190 request or attach the patches to the issue there.
\r
192 2. You get comments and suggestions for improvements.
\r
194 3. Polish, refine, and update/re-send. Go back to step (2).
\r
196 4. The patch will be applied to `master`.
\r