aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CONTRIBUTING.md145
-rw-r--r--README.md11
-rwxr-xr-xscripts/merge-dualHEAD64
3 files changed, 211 insertions, 9 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 7579f6dba..7da80caff 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -1,7 +1,148 @@
#Contributions to the Gentoo Science Overlay
+This guide summerizes the contribution and merging procedures for the Gentoo Science overlay on Github. For more information please visit the [Science Project page](https://wiki.gentoo.org/wiki/Project:Science/Contributing) in the [Gentoo wiki](https://wiki.gentoo.org/).
+
+----
##Prerequisite
+For the most convinient way to work with the overlay you should fulfill all prerequisites.
+
+###Required
+
+* **Install git**
+
+The Science overlay is controlled by [git](http://git-scm.com/). You can install it with
+
+ emerge dev-vcs/git
+
+Familiarize yourself with git and visit [http://git-scm.com/documentation](http://git-scm.com/documentation) for documentation.
+
+* **Account at [github](https://github.com/join)**
+
+Everybody who wants to contribute needs to own an account @ [Github](http://github.com/). Please register yourself [there](https://github.com/join).
+
+###Recommended
+* **Define the echangelog user**
+
+Make sure the ECHANGELOG_USER variable is present in your environment.
+
+ echo 'export ECHANGELOG_USER="John Smith <john@smith.com>"' >> ~/.bashrc
+
+###Optional
+* **Setup commit signing**
+
+Create a [gpg key](http://www.gossamer-threads.com/lists/gentoo/dev/268496?do=post_view_threaded) if you don't have one already and make git use it.
+
+ git config --global user.signingkey <gpg-key-id>
+
+Now git will sign your commits to the overlay by using the gpg key.
+
+* **Install [hub](http://hub.github.com/)**, the *command-line wrapper for git that makes you better at GitHub*.
+
+*hub* can be used equivalent to to *git* and upstream even recommends *"alias git='hub'*.
+
+ emerge dev-vcs/hub
+
+* **Install [repo-commit](https://bitbucket.org/gentoo/repo-commit/)**, *A repository commit helper*
+
+*repo-commit* sanitizes your commit in a convinient way.
+
+ emerge app-portage/repo-commit
+
+---
+##Contributing ebuilds
+
+###Clone the overlay
+
+Create a local checkout of the overlay
+
+ hub clone gentoo-science/sci
+
+###Fork the overlay
+In order to send pull request and ask for inclusion of your changes you need to have your own fork of the overlay on github. You can do this by issuing
+
+ cd sci
+ hub fork
+
+###Branch out for contribution
+It is always convenient for development as well as for the review and merging process, if the development is done in branches.
+
+ git checkout -b my-feature master
+
+###Work on the package
+Now you are ready to work on your package of interest. Once you are finished you should _always_ use **[repoman](http://dev.gentoo.org/~zmedico/portage/doc/man/repoman.1.html)** to do a statical analysis of your work.
+
+This can be done with
+
+ repoman full
+
+###Commit your work
+Once *all* reported problems are resolved, you can commit it
+
+ repo-commit "Here we write a comprehensible commit message"
+
+###Push to Github and make a pull request
+Next we push back the changes to our fork and send a pull-request to the overlay maintainers.
+
+ hub push YOUR_GITHUB_USER
+ hub pull-request
+
+Lastly you need to wait for review comments and the merge of your work. If you feel that they are slacking, don't bother to ping them again. In case you need to include some improvements, just commit your work again using *repo-commit* and push it again to your fork. No need to send another pull-request as your new changes will be added to the original one.
+
+###What's next?
+If you would like to get direct access to the overlay, prove some contribution and ping us via sci@gentoo.org or on irc in #gentoo-science @ freenode. If you would like to become a dev yourself, prove some more contributions and again, contact us. We are always looking for new candidates.
+
+----
+##Merging contributions
+
+**It is important, that if you merge a pull request, you should feel as responsible as if you have written the commits yourself!**
+
+
+
+###Prerequisite
+
+Make sure you have both repos (github & gentoo.org) as remotes defined.
+
+ git remote -v
+
+should give
+
+>github git@github.com:gentoo-science/sci.git (fetch)
+>
+>github git@github.com:gentoo-science/sci.git (push)
+>
+>origin git+ssh://git@git.overlays.gentoo.org/proj/sci.git (fetch)
+>
+>origin git+ssh://git@git.overlays.gentoo.org/proj/sci.git (push)
+
+
+###Review process
+
+In the beginning you should review the pull request on github directly and recommend as much improvements as possible. By this you train the new contributor towards becoming a new dev, which should be our final goal.
+
+####Checking out the pull-request as local branch
+Once everything is fine or you like to fix the rest yourself, simply use the following command to get the pull-request in a new branch in your repo.
+
+ hub checkout https://github.com/gentoo-science/sci/pull/PULLREQUEST-NUMBER
+
+####Testing and repoman check
+Now check the package by building and installing it, and run *repoman* in the package dir. Remember, when merging a pull request you take the responsibility for the quality of the commit.
+
+####Merge the pull-request branch into master
+If this is also fine, merge the branch into the master
+
+ git checkout master
+ git merge USER-BRANCH
+
+####Merging the two remote HEADs
+Finally use the script **merge-dualHEAD** from the *scripts* directory to merge the github and gentoo.org remote repo.
+
+
+---
+####Contribution to the document
+Sebastien Fabbro <bicatali@gentoo.org>
+
+Justin Lecher <jlec@gentoo.org>
-###For Contributors
+This document is available under [Creative Commons Attribution ShareAlike 4.0](http://creativecommons.org/licenses/by-sa/4.0)
-###For Maintainers
+![ccsa-4 icon](http://i.creativecommons.org/l/by-sa/4.0/88x31.png)
diff --git a/README.md b/README.md
index d4dc43f76..446e73a37 100644
--- a/README.md
+++ b/README.md
@@ -1,12 +1,9 @@
-Gentoo Science Overlay
-======================
+#Gentoo Science Overlay
An overlay for Gentoo, geared towards scientific packages.
-Please fork! We will merge!
+Please fork! We will merge! See [this](https://github.com/gentoo-science/sci/blob/master/CONTRIBUTING.md) document for more instructions.
-Ask for help in #gentoo-science in irc freenode.
+Ask for help on irc in #gentoo-science @ freenode.
-Report issues on the github site:
-
-https://github.com/gentoo-science/sci/issues
+Report bugs on the [github issues site](https://github.com/gentoo-science/sci/issues)
diff --git a/scripts/merge-dualHEAD b/scripts/merge-dualHEAD
new file mode 100755
index 000000000..ca05ee4f5
--- /dev/null
+++ b/scripts/merge-dualHEAD
@@ -0,0 +1,64 @@
+#!/bin/bash
+# This script is licensed under BSD-3
+
+if [[ -f /usr/lib64/portage/bin/isolated-functions.sh ]]; then
+ . /usr/lib64/portage/bin/isolated-functions.sh
+elif [[ -f /usr/lib/portage/bin/isolated-functions.sh ]]; then
+ . /usr/lib/portage/bin/isolated-functions.sh
+else
+ alias ebegin=echo
+ alias eend=true
+fi
+
+ebegin "Starting from master"
+ echo
+ git checkout master || exit; _ret=$?
+ echo
+eend ${_ret}
+
+ebegin "Fetching everything"
+ echo
+ git fetch --all -v || exit; _ret=$?
+ echo
+eend ${_ret}
+
+ebegin "Merging github"
+ echo
+ git merge -v github/master || exit; _ret=$?
+ echo
+eend ${_ret}
+
+ebegin "Pushing to g.o.g.o"
+ git push -v origin || exit; _ret=$?
+ echo
+eend ${_ret}
+
+ebegin "Branching out github"
+ echo
+ git checkout -b github-merging github/master || exit; _ret=$?
+ echo
+eend ${_ret}
+
+ebegin "Merging in g.o.g.o"
+ echo
+ git merge -v origin/master || exit; _ret=$?
+ echo
+eend ${_ret}
+
+ebegin "Pushing to github"
+ echo
+ git push -v github HEAD:master || exit; _ret=$?
+ echo
+eend ${_ret}
+
+ebegin "Going back to master"
+ echo
+ git checkout master || exit; _ret=$?
+ echo
+eend ${_ret}
+
+ebegin "Removing github branch"
+ echo
+ git branch -v -D github-merging || exit; _ret=$?
+ echo
+eend ${_ret}