1
1
Submitting a Change to Gerrit
2
2
=============================
3
3
4
- Carefully review the following before submitting a change. These
5
- guidelines apply to developers that are new to open source, as well as
6
- to experienced open source developers.
4
+ Carefully review the following before submitting a change to the
5
+ Hyperledger Fabric code base. These guidelines apply to developers that
6
+ are new to open source, as well as to experienced open source developers.
7
7
8
8
Change Requirements
9
9
-------------------
10
10
11
11
This section contains guidelines for submitting code changes for review.
12
12
For more information on how to submit a change using Gerrit, please see
13
- :doc: `Gerrit <gerrit >`.
13
+ :doc: `Working with Gerrit <gerrit >`.
14
14
15
- Changes are submitted as Git commits. Each commit must contain:
15
+ All changes to Hyperledger Fabric are submitted as Git commits via Gerrit.
16
+ Each commit must contain:
16
17
17
- - a short and descriptive subject line that is 72 characters or fewer,
18
- followed by a blank line.
19
- - a change description with your logic or reasoning for the changes,
20
- followed by a blank line
21
- - a Signed-off-by line, followed by a colon (Signed-off-by:)
18
+ - a short and descriptive subject line that is 55 characters or fewer,
19
+ followed by a blank line,
20
+ - a change description with the logic or reasoning for your changes,
21
+ followed by a blank line,
22
+ - a Signed-off-by line, followed by a colon (Signed-off-by:), and
22
23
- a Change-Id identifier line, followed by a colon (Change-Id:). Gerrit
23
24
won't accept patches without this identifier.
24
25
25
26
A commit with the above details is considered well-formed.
26
27
28
+ .. note :: You don't need to supply the Change-Id identifier for a new
29
+ commit; this is added automatically by the ``commit-msg ``
30
+ Git hook associated with the repository.
31
+ If you subsequently amend your commit and resubmit it,
32
+ using the same Change-Id value as the initial commit will
33
+ guarantee that Gerrit will recognize that subsequent commit
34
+ as an amended commit with respect to the earlier one.
35
+
27
36
All changes and topics sent to Gerrit must be well-formed.
28
- Informationally, ``commit messages `` must include:
37
+ In addition to the above mandatory content in a commit, a commit message
38
+ should include:
29
39
30
40
- **what ** the change does,
31
41
- **why ** you chose that approach, and
32
- - **how ** you know it works -- for example, which tests you ran.
42
+ - **how ** you know it works --- for example, which tests you ran.
33
43
34
44
Commits must :doc: `build cleanly <../dev-setup/build >` when applied on
35
45
top of each other, thus avoiding breaking bisectability. Each commit
36
- must address a single identifiable issue and must be logically
37
- self-contained.
46
+ should address a single identifiable JIRA issue and should be logically
47
+ self-contained. For example, one commit might fix whitespace issues,
48
+ another commit might rename a function, while a third commit could
49
+ change some code's functionality.
38
50
39
- For example: One commit fixes whitespace issues, another renames a
40
- function and a third one changes the code's functionality. An example
41
- commit file is illustrated below in detail:
51
+ A well-formed commit is illustrated below in detail:
42
52
43
53
::
44
54
45
- [FAB-XXXX] A short description of your change with no period at the end
55
+ [FAB-XXXX] purpose of commit, no more than 55 characters
46
56
47
- You can add more details here in several paragraphs, but please keep each line
48
- width less than 80 characters. A bug fix should include the issue number .
57
+ You can add more details here in several paragraphs, but please keep
58
+ each line less than 80 characters long .
49
59
50
60
Change-Id: IF7b6ac513b2eca5f2bab9728ebd8b7e504d3cebe1
51
61
Signed-off-by: Your Name <commit-sender@email.address>
52
62
53
- Include the issue ID in the one line description of your commit message for
54
- readability. Gerrit will link issue IDs automatically to the corresponding
55
- entry in Jira.
56
-
57
- Each commit must also contain the following line at the bottom of the commit
58
- message:
59
-
60
- ::
61
-
62
- Signed-off-by: Your Name <your@email.address>
63
-
64
- The name in the Signed-off-by line and your email must match the change
65
- authorship information. Make sure your :file: ``.git/config `` is set up
66
- correctly. Always submit the full set of changes via Gerrit.
63
+ The name in the ``Signed-off-by: `` line and your email must match the change
64
+ authorship information. Make sure your personal ``.gitconfig `` file is set up
65
+ correctly.
67
66
68
67
When a change is included in the set to enable other changes, but it
69
68
will not be part of the final set, please let the reviewers know this.
@@ -89,10 +88,10 @@ Upon completion, "Hyperledger Jobbuilder" will add to the CR a *+1
89
88
vote * if successful and a *-1 vote * otherwise.
90
89
91
90
In case of failure, explore the logs linked from the CR History. If
92
- you spot a problem with your CR amend your commit and push it to
93
- update it. The CI process will kick off again.
91
+ you spot a problem with your CR, amend your commit and push it to
92
+ update it, which will automatically kick off the CI process again.
94
93
95
- If you see nothing wrong with your CR it might be that the CI process
94
+ If you see nothing wrong with your CR, it might be that the CI process
96
95
simply failed for some reason unrelated to your change. In that case
97
96
you may want to restart the CI process by posting a reply to your CR
98
97
with the simple content "reverify". Check the `CI management page
0 commit comments