summaryrefslogtreecommitdiffstats
path: root/SUBMITTING_PATCHES.md
diff options
context:
space:
mode:
authorMike Frysinger <vapier@google.com>2016-08-16 00:08:37 -0400
committerMike Frysinger <vapier@google.com>2016-08-16 00:14:28 -0400
commitbefaec1e56e70582249f6cd4a5f9de5c012ad718 (patch)
tree60168da9f0f3504846432d61c068b0a5bae510b2 /SUBMITTING_PATCHES.md
parent69297c1b771bbbd05b63e965a524de6860d15d8c (diff)
downloadgit-repo-befaec1e56e70582249f6cd4a5f9de5c012ad718.tar.gz
improve docs
Change-Id: Ide4008f09c2f17f8fb3d85dfffe94544abfdd6a6
Diffstat (limited to 'SUBMITTING_PATCHES.md')
-rw-r--r--SUBMITTING_PATCHES.md115
1 files changed, 115 insertions, 0 deletions
diff --git a/SUBMITTING_PATCHES.md b/SUBMITTING_PATCHES.md
new file mode 100644
index 00000000..085ae06a
--- /dev/null
+++ b/SUBMITTING_PATCHES.md
@@ -0,0 +1,115 @@
1# Short Version
2
3 - Make small logical changes.
4 - Provide a meaningful commit message.
5 - Check for coding errors with pylint
6 - Make sure all code is under the Apache License, 2.0.
7 - Publish your changes for review.
8 - Make corrections if requested.
9 - Verify your changes on gerrit so they can be submitted.
10
11 `git push https://gerrit-review.googlesource.com/git-repo HEAD:refs/for/master`
12
13
14# Long Version
15
16I wanted a file describing how to submit patches for repo,
17so I started with the one found in the core Git distribution
18(Documentation/SubmittingPatches), which itself was based on the
19patch submission guidelines for the Linux kernel.
20
21However there are some differences, so please review and familiarize
22yourself with the following relevant bits.
23
24
25## Make separate commits for logically separate changes.
26
27Unless your patch is really trivial, you should not be sending
28out a patch that was generated between your working tree and your
29commit head. Instead, always make a commit with complete commit
30message and generate a series of patches from your repository.
31It is a good discipline.
32
33Describe the technical detail of the change(s).
34
35If your description starts to get too long, that's a sign that you
36probably need to split up your commit to finer grained pieces.
37
38
39## Check for coding errors with pylint
40
41Run pylint on changed modules using the provided configuration:
42
43 pylint --rcfile=.pylintrc file.py
44
45
46## Check the license
47
48repo is licensed under the Apache License, 2.0.
49
50Because of this licensing model *every* file within the project
51*must* list the license that covers it in the header of the file.
52Any new contributions to an existing file *must* be submitted under
53the current license of that file. Any new files *must* clearly
54indicate which license they are provided under in the file header.
55
56Please verify that you are legally allowed and willing to submit your
57changes under the license covering each file *prior* to submitting
58your patch. It is virtually impossible to remove a patch once it
59has been applied and pushed out.
60
61
62## Sending your patches.
63
64Do not email your patches to anyone.
65
66Instead, login to the Gerrit Code Review tool at:
67
68 https://gerrit-review.googlesource.com/
69
70Ensure you have completed one of the necessary contributor
71agreements, providing documentation to the project maintainers that
72they have right to redistribute your work under the Apache License:
73
74 https://gerrit-review.googlesource.com/#/settings/agreements
75
76Ensure you have obtained an HTTP password to authenticate:
77
78 https://gerrit-review.googlesource.com/new-password
79
80Ensure that you have the local commit hook installed to automatically
81add a ChangeId to your commits:
82
83 curl -Lo `git rev-parse --git-dir`/hooks/commit-msg https://gerrit-review.googlesource.com/tools/hooks/commit-msg
84 chmod +x `git rev-parse --git-dir`/hooks/commit-msg
85
86If you have already committed your changes you will need to amend the commit
87to get the ChangeId added.
88
89 git commit --amend
90
91Push your patches over HTTPS to the review server, possibly through
92a remembered remote to make this easier in the future:
93
94 git config remote.review.url https://gerrit-review.googlesource.com/git-repo
95 git config remote.review.push HEAD:refs/for/master
96
97 git push review
98
99You will be automatically emailed a copy of your commits, and any
100comments made by the project maintainers.
101
102
103## Make changes if requested
104
105The project maintainer who reviews your changes might request changes to your
106commit. If you make the requested changes you will need to amend your commit
107and push it to the review server again.
108
109
110## Verify your changes on gerrit
111
112After you receive a Code-Review+2 from the maintainer, select the Verified
113button on the gerrit page for the change. This verifies that you have tested
114your changes and notifies the maintainer that they are ready to be submitted.
115The maintainer will then submit your changes to the repository.