Commit 62792816 authored by Nigel Kukard's avatar Nigel Kukard
Browse files

Cleaned up submission guidelines

parent 6ee252ef
...@@ -12,7 +12,7 @@ git config --global user.email "your@email" ...@@ -12,7 +12,7 @@ git config --global user.email "your@email"
git config --global user.signingkey "gpg_fingerprint" git config --global user.signingkey "gpg_fingerprint"
git config --global format.signoff true git config --global format.signoff true
git config --global core.whitespace trailing-space,space-before-tab,indent-with-non-tab git config --global core.whitespace trailing-space,space-before-tab
git config --global color.ui true git config --global color.ui true
``` ```
...@@ -26,19 +26,17 @@ You now have your own copy of the repository. ...@@ -26,19 +26,17 @@ You now have your own copy of the repository.
## Clone Locally ## Clone Locally
Clone the repository locally... Clone the origin repository...
```sh ```sh
git clone ssh://git@gitlab.devlabs.linuxassist.net/yourusername/yourreponame.git git clone ssh://git@gitlab.devlabs.linuxassist.net/upstream/repo.git
cd yourreponame
git config format.signature true git config format.signature true
``` ```
You should probably add the upstream repository too so you can do merges and rebases... Add your repository remote...
```sh ```sh
git remote add upstream ssh://git@gitlab.devlabs.linuxassist.net/upstream/repo.git git remote add $USER ssh://git@gitlab.devlabs.linuxassist.net/yourusername/repo.git
git fetch upstream
``` ```
## Make Your Changes ## Make Your Changes
...@@ -50,9 +48,12 @@ We first need to branch, add hunks, review and submit. ...@@ -50,9 +48,12 @@ We first need to branch, add hunks, review and submit.
For each separate change you going to make you must create a branch... For each separate change you going to make you must create a branch...
```sh ```sh
git checkout upstream/master -b your-change-name git fetch origin
git checkout origin/master -b your-change-name
``` ```
Check the commit log and try use branch names that relate to software modules or components.
You can now modify the relevant files. You can now modify the relevant files.
#### Adding Hunk-By-Hunk #### Adding Hunk-By-Hunk
...@@ -82,7 +83,7 @@ git diff --staged ...@@ -82,7 +83,7 @@ git diff --staged
If you are 100% happy, commit your chagnes using the below, making sure of course all your changes must contain the Signed-Off line... If you are 100% happy, commit your chagnes using the below, making sure of course all your changes must contain the Signed-Off line...
```sh ```sh
git commit git commit --signoff
``` ```
...@@ -107,11 +108,13 @@ Be sure to read the code [Submission Policy](https://gitlab.devlabs.linuxassist. ...@@ -107,11 +108,13 @@ Be sure to read the code [Submission Policy](https://gitlab.devlabs.linuxassist.
Make sure your code is based off the main repo and push your branch... Make sure your code is based off the main repo and push your branch...
```sh ```sh
git fetch upstream git fetch origin
git rebase upstream/master git rebase origin/master
git push origin yourbranchname:descriptive-name git push $USER -f
``` ```
We use the -f option for force overwriting of your branch in your forked repository.
### Submit Upstream ### Submit Upstream
Using the web interface you can then create a merge request: Using the web interface you can then create a merge request:
...@@ -132,10 +135,13 @@ Go through each comment one by one and commit the fixes as required. ...@@ -132,10 +135,13 @@ Go through each comment one by one and commit the fixes as required.
You do NOT want to submit 20,000 commits, squashing will take all the changes and squash them into 1 commit. Replace X with how many extra comments you made PLUS 1 to include your original commit. You do NOT want to submit 20,000 commits, squashing will take all the changes and squash them into 1 commit. Replace X with how many extra comments you made PLUS 1 to include your original commit.
You can also re-order commits in order to squash similar commits together.
To squash all commits since "master", use... To squash all commits since "master", use...
```sh ```sh
git rebase -i upstream/master git fetch origin
git rebase -i origin/master
``` ```
To squash X number of commits use the following... To squash X number of commits use the following...
...@@ -146,40 +152,13 @@ git rebase -i HEAD~X ...@@ -146,40 +152,13 @@ git rebase -i HEAD~X
In all cases will be presented with a list of commits. Replace `pick` with `s` on all but your original commit. The next step will present you with a commit message with all your commit messages included for edit. In all cases will be presented with a list of commits. Replace `pick` with `s` on all but your original commit. The next step will present you with a commit message with all your commit messages included for edit.
### Re-Submitting ### Re-Pushing
You can now re-submit your changes by forcing a ref update... You can now re-push your changes by forcing a ref update...
``` ```
git push -f origin yourbranchname:same-descriptive-name git fetch origin
``` git rebase origin/master
git push $USER -f
## Further Changes
There are multiple ways to contribute further changes.
### Simply Branch Main Repo (easy way)
Branch the original repo and apply your changes to it.
```sh
git fetch upstream
git checkout upstream/master -b yourbranchname
git push origin yourbranchname:descriptive-name
```
### Bringing Your Branch Up To Date
Rebase your changes off the main repo. Make sure you are in your branch with your changes committed.
```sh
git fetch upstream
git rebase upstream/master
```
Push your changes...
```sh
git push origin yourbranchname:descriptive-name
``` ```
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment