@@ -26,66 +26,42 @@ so the code can make it into the master branch as quickly as possible.
2626How To Submit Code
2727------------------
2828
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:
31-
32- go get github.com/google/gopacket
33- cd $GOROOT/src/pkg/github.com/google/gopacket
34- git checkout -b <mynewfeature> # create a new branch to work from
35- ... code code code ...
36- ./gc # Run this to do local commits, it performs a number of checks
37- ... code code code ...
38- ./gc --benchmark # Run this whenever your commit could affect performance
39-
40- Now that you're in the gopacket code directory, you can start making your initial
41- change. PLEASE make sure you're using a new branch to develop whatever feature
42- you're working on.
43-
44- Once you've got your code to a place where you're ready to have us look at it,
45- send an email to gopacket@googlegroups.com , detailing your change. We'll add
46- you as a committer, and you can upload your feature branch to github.com/google/gopacket.
47- From there, the other folks working on gopacket can give you code reviews with
48- the github.com code review functionality.
49-
50- The code review will generally be either emails or line-by-line reviews via
51- github.com. One or more folks might review your code. The review should
52- be considered "complete" when at least one of the project Owners (see
53- https://github.com/orgs/google/people ) gives you permission to merge to
54- master. At that point, you can merge to master yourself, or you can have one of
55- the other committers/owners do it for you.
56-
57- When doing the final merge, please try to capture any interesting comments or
58- discussions that came up in code review. This will help future contributors be
59- able to find and reference those discussions later on.
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.
37+
38+ ``` sh
39+ go get github.com/google/gopacket
40+ cd $GOROOT /src/pkg/github.com/google/gopacket
41+ git checkout -b < mynewfeature> # create a new branch to work from
42+ ... code code code ...
43+ ./gc # Run this to do local commits, it performs a number of checks
44+ ```
6045
6146To sum up:
6247
6348* DO
6449 + Pull down the latest version.
6550 + Make a feature-specific branch.
6651 + Code using the style and methods discussed in the rest of this document.
67- + Use the ./gc command to do local commits.
68- + Send an email asking us to make you a committer (if you're new).
69- + 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.
7054 + Handle comments and requests from reviewers, pushing new commits up to
7155 your feature branch as problems are addressed.
72- + Get approval from a project Owner to merge to master.
73- + Merge yourself, or have another Committer/Owner do it for you.
7456 + Put interesting comments and discussions into commit comments.
7557* DON'T
76- + Push directly to master.
7758 + Push to someone else's branch without their permission.
78- + Merge your own code to master without sign-off from others on the project.
79- + Rebase (please merge)
80- * OPTIONAL
81- + Review others' code as it comes in (politely :)
82- + Keep contributing!
8359
8460
8561Coding Style
8662------------
8763
88- * Go code must be run through ' go fmt'.
64+ * Go code must be run through ` go fmt ` , ` go vet ` , and ` golint `
8965* Follow http://golang.org/doc/effective_go.html as much as possible.
9066 + In particular, http://golang.org/doc/effective_go.html#mixed-caps . Enums
9167 should be be CamelCase, with acronyms capitalized (TCPSourcePort, vs.
0 commit comments