CONTRIBUTING.md: clarify signed-off-by advice
[project/luci.git] / CONTRIBUTING.md
1 # Contributing Guidelines
2
3 ## Patches and Pull requests:
4
5 If you want to contribute a change to LuCI, please either send a patch using git send-email
6 or open a "pull request" against the openwrt/luci repository.
7
8 Regardless of whether you send a patch or open a pull request, please try to follow these rules:
9
10 * Have a useful subject prefixed with the component name
11 (E.g.: "luci-mod-admin-full: fix wifi channel selection on multiple STA networks")
12 * Shortly explain the changes made and - if applicable - the reasoning behind them
13 * Commit message of each commit should include a Signed-off-by line
14 (See <https://dev.openwrt.org/wiki/SubmittingPatches#a10.Signyourwork>)
15
16 In case you like to send patches by mail, please use the [LuCI mailinglist](https://lists.subsignal.org/mailman/listinfo/luci)
17 or the [OpenWrt Development List](https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel).
18
19 If you send via the OpenWrt list, include a "[luci]" tag in your subject line.
20 For general information on patch submission, follow the [OpenWrt patch submission guideline](https://dev.openwrt.org/wiki/SubmittingPatches).
21
22 ## Advice on pull requests:
23
24 Pull requests are the easiest way to contribute changes to git repos at Github. They are the preferred contribution method, as they offer a nice way for commenting and amending the proposed changes.
25
26 * You need a local "fork" of the Github repo.
27 * Use a "feature branch" for your changes. That separates the changes in the pull request from your other changes and makes it easy to edit/amend commits in the pull request. Workflow using "feature_x" as the example:
28 - Update your local git fork to the tip (of the master, usually)
29 - Create the feature branch with `git checkout -b feature_x`
30 - Edit changes and commit them locally
31 - Push them to your Github fork by `git push -u origin feature_x`. That creates the "feature_x" branch at your Github fork and sets it as the remote of this branch
32 - When you now visit Github, you should see a proposal to create a pull request
33
34 * If you later need to add new commits to the pull request, you can simply commit the changes to the local branch and then use `git push` to automatically update the pull request.
35
36 * If you need to change something in the existing pull request (e.g. to add a missing signed-off-by line to the commit message), you can use `git push -f` to overwrite the original commits. That is easy and safe when using a feature branch. Example workflow:
37 - Checkout the feature branch by `git checkout feature_x`
38 - Edit changes and commit them locally. If you are just updating the commit message in the last commit, you can use `git commit --amend` to do that
39 - If you added several new commits or made other changes that require cleaning up, you can use `git rebase -i HEAD~X` (X = number of commits to edit) to possibly squash some commits
40 - Push the changed commits to Github with `git push -f` to overwrite the original commits in the "feature_x" branch with the new ones. The pull request gets automatically updated
41
42 ## If you have commit access:
43
44 * Do NOT use git push --force.
45 * Use Pull Requests if you are unsure and to suggest changes to other developers.
46
47 ## Gaining commit access:
48
49 * Commit access will be granted to responsible contributors who have made
50 useful pull requests and / or feedback or patches to this repository or
51 OpenWrt in general. Please include your request for commit access in your
52 next pull request or ticket.
53
54 ## Release Branches:
55
56 * Branches named "for-XX.YY" or "luci-X.Y" (e.g. "for-15.05") are release branches.
57 * These branches are built with the respective OpenWrt release and are created
58 during the release stabilisation phase.
59 * Please ONLY cherry-pick or commit security and bug-fixes to these branches.
60 * Do NOT add new packages and do NOT do major upgrades of packages here.
61 * If you are unsure if your change is suitable, please use a pull request.
62