|
| 1 | + |
| 2 | +CONTRIBUTING. |
| 3 | + |
| 4 | +Please read the following guidelines before contributing. |
| 5 | + |
| 6 | +1. The basic unit of contribution is a "git commit". This will be merged into |
| 7 | +master by one of the team members who will review it and sign-off/commit or |
| 8 | +reject it. If the commit is in another branch, it will added to HEAD/master |
| 9 | +using |
| 10 | + |
| 11 | + git cherry-pick -s <tree-ish> |
| 12 | + |
| 13 | +Or if the commit is submitted as a stand alone file produce by |
| 14 | + |
| 15 | + git format-patch <tree-ish> |
| 16 | + |
| 17 | +Then it will be committed by |
| 18 | + |
| 19 | + git am -s 0001-foo-bar.patch |
| 20 | + |
| 21 | +Or if the commit is submitted as a github merge request, then the github web |
| 22 | +interface can be used. |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | +2. Work in a branch immediately off of master, do not work directly in master, |
| 27 | +and do not be afraid of creating a local branch for every experimental thing you |
| 28 | +want to try: |
| 29 | + |
| 30 | + git checkout master # make sure your on master |
| 31 | + git branch idea1 # I've got an idea, let me work on it |
| 32 | + git checkout idea1 |
| 33 | + <hack ... hack ... hack> |
| 34 | + git commit -m "step1" # I like what I've done so far, but I'm not finished |
| 35 | + <hack ... hack ... hack> |
| 36 | + git commit -m "step2" |
| 37 | + <hack ... hack ... hack> |
| 38 | + git commit -m "step3" |
| 39 | + <hack ... hack ... hack> |
| 40 | + git revert <tree-ish for step2> # Wow step 2 was dumb |
| 41 | + <hack ... hack ... hack> |
| 42 | + git commit -m "step4" # Its good now, but those |
| 43 | + # commits are messy |
| 44 | + |
| 45 | + git rebase -i <tree-ish step1>^ # start a rebase on the parent of step1 |
| 46 | + (drop into editor and squash commits) # note the ^ at the end! |
| 47 | + (exit editor and fix commit message) |
| 48 | + |
| 49 | +Alternatively, you can cherry-pick those commits into another prestine branch: |
| 50 | + |
| 51 | + ... its good to go! .... |
| 52 | + |
| 53 | + git checkout master |
| 54 | + git branch idea1-clean |
| 55 | + git checkout idea1-clean |
| 56 | + git cherry-pick <sha1-of-good-commit1> |
| 57 | + git cherry-pick <sha1-of-good-commit2> |
| 58 | + (pick them in any order that stacks) |
| 59 | + (you can skip commits, but do them in the correct order to avoid conflits) |
| 60 | + git rebase -i <tree-ish of sha1-of-good-commit1>^ # squash many commits into one |
| 61 | + # note the ^ at the end! |
| 62 | + |
| 63 | +Once you are done with a local branch you can delete it using |
| 64 | + |
| 65 | + git branch -D idea1 |
| 66 | + |
| 67 | +You can delete a remote branch by doing |
| 68 | + |
| 69 | + git push origin :idea1 |
| 70 | + |
| 71 | + |
| 72 | + |
| 73 | +3. Your commit message should conform to the following standard: |
| 74 | + |
| 75 | + file/changed: Concice and complete statement of the purpose |
| 76 | + |
| 77 | + This is the body of the commit message. The line above is the |
| 78 | + summary. The summary should be no more than 72 chars long. The |
| 79 | + body can be more freely formatted, but make it look nice. Make |
| 80 | + sure to reference any bug reports and other contributors. Make |
| 81 | + sure the correct authorship appears. Reference any early commits |
| 82 | + by their full shaw: |
| 83 | + |
| 84 | + b52c6402b5b42620571c36c74a12dcb45ec1e0d6 |
| 85 | + |
| 86 | + which you can put on its own line and indent. |
| 87 | + |
| 88 | + X-Gentoo-Bug: 400837 |
| 89 | + X-Gentoo-Bug-URL: https://bugs.gentoo.org/400837 |
| 90 | + |
| 91 | + Reported-by: Snoopy Coderdog < [email protected]> |
| 92 | + Signed-off-by: Anthony G. Basile < [email protected]> |
| 93 | + |
| 94 | +If you commit using |
| 95 | + |
| 96 | + git commit -s |
| 97 | + |
| 98 | +your sign-off will be automatically added. If the authorship is wrong |
| 99 | +fix it by |
| 100 | + |
| 101 | + git commit -s --author="Richard Feynmann < [email protected]>" |
| 102 | + |
| 103 | +If the message doesn't look right after you commit locally, you can fix it by |
| 104 | +doing |
| 105 | + |
| 106 | + git commit --amend. |
| 107 | + |
| 108 | +Then push it to your public repo. |
| 109 | + |
| 110 | + |
| 111 | +4. Open an issue at |
| 112 | + |
| 113 | + https://github.com/gentoo/eudev/issues?state=open |
| 114 | + |
| 115 | +And request a pull of your clean commit. A team member will review it, |
| 116 | +discuss it and commit it to master or reject it. |
| 117 | + |
| 118 | + |
| 119 | +5. eudev is a peer-reviewed project. So even team members must ask another |
| 120 | +team member to sign-off and commit your work. The only exception are trivial |
| 121 | +commits |
| 122 | + |
| 123 | + |
| 124 | +6. HEAD/master must always build and must always be considered stable. |
| 125 | + |
| 126 | + |
| 127 | +7. Releases should be tagged and signed using |
| 128 | + |
| 129 | + git tag -s -u <gpg name> -m "Release X" |
| 130 | + |
| 131 | +where X is the full release number. Make sure that before you release, |
| 132 | +you change the value in AC_INIT of configure.ac to match the release |
| 133 | +number. |
| 134 | + |
| 135 | + |
| 136 | +8. Tarball releases should be made from HEAD/master at signed tagged points |
| 137 | +by doing |
| 138 | + |
| 139 | + autogen.sh |
| 140 | + ./configure |
| 141 | + make |
| 142 | + make dist |
| 143 | + |
| 144 | + |
| 145 | +9. TODO: coding style for C, python, perl and autotool stuff. |
0 commit comments