blob: 5a82fd9299ebad9557542f24923dd0c2762c735a [file] [log] [blame]
Shawn O. Pearce13a72f22009-07-02 13:45:52 -07001Short Version:
2
3 - Make small logical changes.
4 - Provide a meaningful commit message.
5 - Make sure all code is under the Apache License, 2.0.
J. Lewis Muir07279472018-01-11 12:21:25 -06006 - Make sure all commit messages have a Change-Id.
Shawn O. Pearce13a72f22009-07-02 13:45:52 -07007 - Publish your changes for review:
8
Shawn O. Pearce58874c02012-03-23 16:34:20 -07009 git push https://gerrit.googlesource.com/gerrit HEAD:refs/for/master
Shawn O. Pearce13a72f22009-07-02 13:45:52 -070010
11
12Long Version:
13
14I wanted a file describing how to submit patches for Gerrit,
15so I started with the one found in the core Git distribution
16(Documentation/SubmittingPatches), which itself was based on the
17patch submission guidelines for the Linux kernel.
18
19However there are some differences, so please review and familiarize
20yourself with the following relevant bits:
21
22
23(1) Make separate commits for logically separate changes.
24
25Unless your patch is really trivial, you should not be sending
26out a patch that was generated between your working tree and your
27commit head. Instead, always make a commit with complete commit
28message and generate a series of patches from your repository.
29It is a good discipline.
30
31Describe the technical detail of the change(s).
32
33If your description starts to get too long, that's a sign that you
34probably need to split up your commit to finer grained pieces.
35
36
37(2) Check the license
38
39Gerrit Code Review is licensed under the Apache License, 2.0.
40
41Because of this licensing model *every* file within the project
42*must* list the license that covers it in the header of the file.
43Any new contributions to an existing file *must* be submitted under
44the current license of that file. Any new files *must* clearly
45indicate which license they are provided under in the file header.
46
47Please verify that you are legally allowed and willing to submit your
48changes under the license covering each file *prior* to submitting
49your patch. It is virtually impossible to remove a patch once it
50has been applied and pushed out.
51
52
53(3) Sending your patches.
54
55Do not email your patches to anyone.
56
57Instead, login to the Gerrit Code Review tool at:
58
Shawn O. Pearce54765512012-02-13 18:53:49 -080059 https://gerrit-review.googlesource.com/
Shawn O. Pearce13a72f22009-07-02 13:45:52 -070060
61Ensure you have completed one of the necessary contributor
62agreements, providing documentation to the project maintainers that
63they have right to redistribute your work under the Apache License:
64
Shawn O. Pearce54765512012-02-13 18:53:49 -080065 https://gerrit-review.googlesource.com/#/settings/agreements
Shawn O. Pearce13a72f22009-07-02 13:45:52 -070066
Shawn O. Pearce54765512012-02-13 18:53:49 -080067Ensure you have obtained a unique HTTP password to identify yourself:
Shawn O. Pearce13a72f22009-07-02 13:45:52 -070068
Shawn O. Pearce54765512012-02-13 18:53:49 -080069 https://gerrit-review.googlesource.com/#/settings/http-password
Shawn O. Pearce13a72f22009-07-02 13:45:52 -070070
J. Lewis Muir07279472018-01-11 12:21:25 -060071Ensure you have installed the commit-msg hook that automatically
72generates and inserts a Change-Id line during "git commit". This can
73be done from the root directory of the local Git repository:
74
75 curl -Lo .git/hooks/commit-msg https://gerrit-review.googlesource.com/tools/hooks/commit-msg
76 chmod +x .git/hooks/commit-msg
77
Shawn O. Pearce54765512012-02-13 18:53:49 -080078Push your patches over HTTPS to the review server, possibly through
Shawn O. Pearce13a72f22009-07-02 13:45:52 -070079a remembered remote to make this easier in the future:
80
Shawn O. Pearce58874c02012-03-23 16:34:20 -070081 git config remote.review.url https://gerrit.googlesource.com/gerrit
Shawn O. Pearce13a72f22009-07-02 13:45:52 -070082 git config remote.review.push HEAD:refs/for/master
83
84 git push review
85
86You will be automatically emailed a copy of your commits, and any
87comments made by the project maintainers.