https://bitbucket.org/daniel_fort/magic-lantern
Raw File
Tip revision: 8d6db89dbca794b3db01b6a6753e5d3312483b21 authored by Daniel Fort on 10 March 2019, 07:19:14 UTC
Merged in raw_video_10bit_12bit_LVState_7D_experiments
Tip revision: 8d6db89
check-bb-pull-request.sh
#!/bin/sh
#
# This script uses experimental bitbacket API!
#
# see details:
#   https://answers.atlassian.com/questions/163739/what-is-the-url-of-a-pull-request?page=1
#

CHECKPATCH=scripts/checkpatch.pl

PREQ_NUM=$1

[ "$PREQ_NUM" -gt 0 ] 2>/dev/null
if [ "$?" != 0 ]; then
	echo "Usage:"
	echo "    scripts/check-bb-pull-request.sh <pull request number>"
	exit 2
fi

if [ ! -x "$CHECKPATCH" ]; then
	echo "no checkpatch utility ($CHECKPATCH)!"
	exit 1
fi

TFILE=$(mktemp)

wget https://bitbucket.org/api/2.0/repositories/hudson/magic-lantern/pullrequests/$PREQ_NUM/patch -O $TFILE 2>/dev/null
if [ "$?" = "0" ]; then
	$CHECKPATCH $TFILE | \
		sed "s/^.*\(has no obvious style pr\)/Pull request #$PREQ_NUM \1/"
else
	echo "Can't download pull requst #$PREQ_NUM"
fi

rm -f $TFILE
back to top