On Thu, Jul 11, 2013 at 08:43:55AM +0200, Harald Welte wrote:
Hi Holger,
On Thu, Jul 11, 2013 at 07:52:08AM +0200, Holger Hans Peter Freyther wrote:
I classified this as a social problem because if
someone is repeatable
not willing to run make and make check on the last commit, I doubt
that he will run an extra script as part of his development process.
I would definitely [want] to use such a script.
A proof of concept requiring git 1.8 is like this (and it includes a todo
list).
#!/bin/sh
# Say hello
echo "Going to rebase your branch against master and testing"
# TODO:
# 1.) Check for git 1.8 for the -x option
# 2.) Check/Find checkpatch.pl installed on the system or copy it
# 3.) Make it work with OpenBSC and make -C openbsc/ as parameter
# 4.) Integrate it to a Makefile.am (like make check-for-submit)
# 5.) Install a trap handler to issue a git rebase --abort
CHECKPATCH="checkpatch.pl - --no-signoff --ignore LONG_LINE"
CMD="make check && make distcheck && (git format-patch --stdout
HEAD^1..HEAD | $CHECKPATCH)"
BRANCH="origin/master"
EDITOR=/bin/true git rebase -i -x "$CMD" $BRANCH #> /dev/null 2>&1
RES=$?
if [ $RES -eq 0 ]; then
echo "All looks fine"
else
# Execute again...
eval $CMD
echo "Stuff isn't working!!!! Consider using git rebase --abort"
exit 1
fi