diff options
-rw-r--r-- | CONTRIB | 28 | ||||
-rwxr-xr-x | contrib.msg | 4 | ||||
-rwxr-xr-x | contrib.sh | 59 |
3 files changed, 91 insertions, 0 deletions
@@ -0,0 +1,28 @@ +Permissively licensed components of the midipix project currently +accept contributions in the form of gpg-signed patches. The requirement +that all contributions be gpg-signed helps to ensure a repository's +reliability and license integrity, and is thus considered worth of +the (small) trouble that it might entail. + +Please note that patch submission is only one of the many ways to +advance the development of a software component, and that assistance +in the following areas is always needed, and greatly appreciated: + +* brainstorming. +* expressing needs, requesting features. +* sharing knowledge about your favorite system. +* lurking on irc, reviewing commits and patches. +* testing release candidates on different system. +* building from source, testing bleeding-edge versions. + + +If you would like to submit code, then the following how-to is for you. + +1. discuss your proposed changes on the project's freenode irc channel. +2. if the changes you propose are not trivial to accept, start a discussion + on the project's mailing list. +3. obtain as much help as needed on irc; post early versions of your work. +4. finalize your patch together with the project maintainer. +5. commit the patch to your local repository. +6. verify that everything builds, and that nothing breaks. +7 run contrib.sh, then sign and submit your patch. diff --git a/contrib.msg b/contrib.msg new file mode 100755 index 0000000..40d549f --- /dev/null +++ b/contrib.msg @@ -0,0 +1,4 @@ +====================================================================== +this patch is being submitted to the midipix project (www.midipix.org) +for inclusion in the slibtool component (git://midipix.org/slibtool) +====================================================================== diff --git a/contrib.sh b/contrib.sh new file mode 100755 index 0000000..501b539 --- /dev/null +++ b/contrib.sh @@ -0,0 +1,59 @@ +#!/bin/sh + +# init vars +commit=$1; [ -z "$commit" ] && commit='HEAD' +blank= +bline= +fname= + +# source.patch +git format-patch -1 $commit --stdout > source.patch || exit 2 +cat contrib.msg >> source.patch || exit 2 + +# source.patch without the (noisy) first line +tail -n +2 source.patch > contrib.patch || exit 2 + +# contrib.patch: first blank line +blank=`grep -n ^$ contrib.patch | head -n1` +[ -z "$blank" ] && exit 2 + +bline=`echo $blank | cut -f1 -d':'` +[ -z "$bline" ] && exit 2 + +# use sha256sum of the above for patch file name +fname=`sha256sum contrib.patch | cut -f1 -d' '` || exit 2 +[ -z "$fname" ] && exit 2 + +# prepare for submission, sign the patch +mv contrib.patch $fname.patch || exit 2 +head -n$bline $fname.patch | tail -n +2 > $fname.sig || exit 2 + +[ -z "$PAGER" ] && PAGER='less' +$PAGER $fname.patch || exit 2 +cat contrib.msg || exit 2 + +echo +echo 'press <enter> to continue, <ctrl-c> to abort>' +echo + +read enter + +gpg --armor --detach-sign $fname.patch || exit 2 +cat $fname.patch.asc >> $fname.sig || exit 2 + +# verify +gpg --verify $fname.sig $fname.patch || exit 2 + +# clean up +rm source.patch +rm $fname.patch.asc + +# info +echo +echo "commit $commit was successfully prepared for submission." +echo "$fname.patch: a patch file that can be imported by git-am." +echo "$fname.sig: a gpg signature file of the above patch." +echo + +# all done +exit 0 |