@@ -26,68 +26,42 @@ so the code can make it into the master branch as quickly as possible.
26
26
How To Submit Code
27
27
------------------
28
28
29
- gopacket uses the Git version control system. If you want to
30
- make a new change, you'll first have to get our code:
29
+ We use github.com's Pull Request feature to receive code contributions from
30
+ external contributors. See
31
+ https://help.github.com/articles/creating-a-pull-request/ for details on
32
+ how to create a request.
33
+
34
+ Also, there's a local script ` gc ` in the base directory of GoPacket that
35
+ runs a local set of checks, which should give you relatively high confidence
36
+ that your pull won't fail github pull checks.
31
37
32
38
``` sh
33
39
go get github.com/google/gopacket
34
40
cd $GOROOT /src/pkg/github.com/google/gopacket
35
41
git checkout -b < mynewfeature> # create a new branch to work from
36
42
... code code code ...
37
43
./gc # Run this to do local commits, it performs a number of checks
38
- ... code code code ...
39
- ./gc --benchmark # Run this whenever your commit could affect performance
40
44
```
41
45
42
- Now that you're in the gopacket code directory, you can start making your initial
43
- change. PLEASE make sure you're using a new branch to develop whatever feature
44
- you're working on.
45
-
46
- Once you've got your code to a place where you're ready to have us look at it,
47
- send an email to
[email protected] , detailing your change. We'll add
48
- you as a committer, and you can upload your feature branch to github.com/google/gopacket.
49
- From there, the other folks working on gopacket can give you code reviews with
50
- the github.com code review functionality.
51
-
52
- The code review will generally be either emails or line-by-line reviews via
53
- github.com. One or more folks might review your code. The review should
54
- be considered "complete" when at least one of the project Owners (see
55
- https://github.com/orgs/google/people ) gives you permission to merge to
56
- master. At that point, you can merge to master yourself, or you can have one of
57
- the other committers/owners do it for you.
58
-
59
- When doing the final merge, please try to capture any interesting comments or
60
- discussions that came up in code review. This will help future contributors be
61
- able to find and reference those discussions later on.
62
-
63
46
To sum up:
64
47
65
48
* DO
66
49
+ Pull down the latest version.
67
50
+ Make a feature-specific branch.
68
51
+ Code using the style and methods discussed in the rest of this document.
69
- + Use the ./gc command to do local commits.
70
- + Send an email asking us to make you a committer (if you're new).
71
- + Push your new feature branch up to github.com.
52
+ + Use the ./gc command to do local commits or check correctness.
53
+ + Push your new feature branch up to github.com, as a pull request.
72
54
+ Handle comments and requests from reviewers, pushing new commits up to
73
55
your feature branch as problems are addressed.
74
- + Get approval from a project Owner to merge to master.
75
- + Merge yourself, or have another Committer/Owner do it for you.
76
56
+ Put interesting comments and discussions into commit comments.
77
57
* DON'T
78
- + Push directly to master.
79
58
+ Push to someone else's branch without their permission.
80
- + Merge your own code to master without sign-off from others on the project.
81
- + Rebase (please merge)
82
- * OPTIONAL
83
- + Review others' code as it comes in (politely :)
84
- + Keep contributing!
85
59
86
60
87
61
Coding Style
88
62
------------
89
63
90
- * Go code must be run through ' go fmt'.
64
+ * Go code must be run through ` go fmt ` , ` go vet ` , and ` golint `
91
65
* Follow http://golang.org/doc/effective_go.html as much as possible.
92
66
+ In particular, http://golang.org/doc/effective_go.html#mixed-caps . Enums
93
67
should be be CamelCase, with acronyms capitalized (TCPSourcePort, vs.
0 commit comments