blob: 3a0233f86e390d78d33c6d878effd0be12cb033f [file] [log] [blame]
Git Development Community1a6964c2009-09-29 16:47:03 -07001Short Version:
2
3 - Make small logical changes.
4 - Provide a meaningful commit message.
5
Shawn O. Pearcee300e2b2009-10-02 09:42:44 -07006 - Review and follow the Eclipse Due Diligence Process
Git Development Community1a6964c2009-09-29 16:47:03 -07007
Shawn O. Pearce31603c02009-10-02 09:47:04 -07008 http://www.eclipse.org/projects/dev_process/ip-process-in-cartoons.php
Shawn O. Pearcee300e2b2009-10-02 09:42:44 -07009 http://www.eclipse.org/legal/EclipseLegalProcessPoster.pdf
Git Development Community1a6964c2009-09-29 16:47:03 -070010
Shawn O. Pearcee300e2b2009-10-02 09:42:44 -070011 - Review and follow the current guidelines:
Git Development Community1a6964c2009-09-29 16:47:03 -070012
Shawn O. Pearcee300e2b2009-10-02 09:42:44 -070013 http://wiki.eclipse.org/EGit/Contributor_Guide
Git Development Community1a6964c2009-09-29 16:47:03 -070014
Git Development Community1a6964c2009-09-29 16:47:03 -070015
16Long Version:
17
18I wanted a file describing how to submit patches for JGit,
19so I started with the one found in the core Git distribution
20(Documentation/SubmittingPatches), which itself was based on the
21patch submission guidelines for the Linux kernel.
22
Shawn O. Pearcef4964352009-10-02 09:50:48 -070023However there are quite a few differences, so please review and
24familiarize yourself with the following relevant bits:
Git Development Community1a6964c2009-09-29 16:47:03 -070025
26
27(1) Make separate commits for logically separate changes.
28
29Unless your patch is really trivial, you should not be sending
30out a patch that was generated between your working tree and your
31commit head. Instead, always make a commit with complete commit
32message and generate a series of patches from your repository.
33It is a good discipline.
34
35Describe the technical detail of the change(s).
36
37If your description starts to get too long, that's a sign that you
38probably need to split up your commit to finer grained pieces.
39
40I am very picky about formatting. Make sure your final version
41of every file was formatted using the Eclipse code formatter
42using the project specific settings (Properties->Java Code
43Style->Formatter->"Java Conventions [built-in]").
44
45
46(2) Generate your patch using git tools out of your commits.
47
48git based diff tools (git, and StGIT included) generate unidiff,
49which is the only acceptable format.
50
51You do not have to be afraid to use -M option to "git diff" or "git
52format-patch", if your patch involves file renames. The receiving
53end can handle them just fine.
54
55Please make sure your patch does not include any extra files which
56do not belong in a patch submission. Make sure to review your
57patch after generating it, to ensure accuracy. Before sending out,
58please make sure it cleanly applies to the "master" branch head.
59
60
Shawn O. Pearcef4964352009-10-02 09:50:48 -070061(3) Check the license.
Git Development Community1a6964c2009-09-29 16:47:03 -070062
Matthias Sohnf3d75802009-10-28 13:57:32 +010063JGit is licensed under the Eclipse Distribution License (EDL,
64http://www.eclipse.org/org/documents/edl-v10.html), which is a
65renamed version of the new style/3-clause BSD license.
Git Development Community1a6964c2009-09-29 16:47:03 -070066
Shawn O. Pearcef4964352009-10-02 09:50:48 -070067Under this licensing model *every* file within the project
Git Development Community1a6964c2009-09-29 16:47:03 -070068*must* list which license covers it in the header of the file.
69Any new contributions to an existing file *must* be submitted under
70the current license of that file. Any new files *must* clearly
71indicate which license they are provided under in the file header.
72
73Please verify that you are legally allowed and willing to submit your
74changes under the license covering each file *prior* to submitting
75your patch. It is virtually impossible to remove a patch once it
76has been applied and pushed out.
77
78
Shawn O. Pearcef4964352009-10-02 09:50:48 -070079(4) Review the Eclipse Due Diligence Process.
Git Development Community1a6964c2009-09-29 16:47:03 -070080
Shawn O. Pearcef4964352009-10-02 09:50:48 -070081 http://www.eclipse.org/legal/EclipseLegalProcessPoster.pdf
Git Development Community1a6964c2009-09-29 16:47:03 -070082
83
Shawn O. Pearcef4964352009-10-02 09:50:48 -070084(5) Sending your patches.
Git Development Community1a6964c2009-09-29 16:47:03 -070085
Shawn O. Pearcef4964352009-10-02 09:50:48 -070086"git format-patch" command follows the best current practice to
87format a commit as a reviewable text message.
Git Development Community1a6964c2009-09-29 16:47:03 -070088
Shawn O. Pearcef4964352009-10-02 09:50:48 -070089At the beginning of the patch should come your commit message,
90a line that consists of three dashes, followed by the diffstat
91information and the patch itself. If you are forwarding a patch
92from somebody else, optionally, at the beginning of the e-mail
93message just before the commit message starts, you can put a "From:
94" line to name that person.
Git Development Community1a6964c2009-09-29 16:47:03 -070095
Shawn O. Pearcef4964352009-10-02 09:50:48 -070096You often want to add additional explanation about the patch,
97other than the commit message itself. Place such "cover letter"
98material between the three dash lines and the diffstat, or please
99place it in the bug description itself.
Git Development Community1a6964c2009-09-29 16:47:03 -0700100
Shawn O. Pearcef4964352009-10-02 09:50:48 -0700101Open a new bug on the Eclipse bug tracker on the EGit project:
Git Development Community1a6964c2009-09-29 16:47:03 -0700102
Shawn O. Pearcef4964352009-10-02 09:50:48 -0700103 https://bugs.eclipse.org/bugs/enter_bug.cgi?product=EGit
Git Development Community1a6964c2009-09-29 16:47:03 -0700104
Shawn O. Pearcef4964352009-10-02 09:50:48 -0700105Attach the mailbox file(s) created by "git format-patch" to the bug.
Git Development Community1a6964c2009-09-29 16:47:03 -0700106