}
auto=false
+eval set -- `getopt -- eh "$@"`
while [[ -n $1 ]] ; do
case $1 in
-h|--help) usage;;
shift
done
-commit=$1
+commit=${1:-mainline/master}
url=$(git config --get remote.origin.url)
branch=${2:-master}
+if [[ ${branch} != master ]] ; then
+ subject=" (${branch} branch)"
+else
+ subject=""
+fi
if [[ -z ${commit} ]] || [[ -n $3 ]] ; then
usage 1
name=$(git config --get user.name)
email=$(git config --get user.email)
tmp=$(mktemp)
+request=$(PAGER= git request-pull ${commit} ${url} ${branch}) || exit 1
cat << EOF > ${tmp}
From: ${name} <${email}>
Date: $(date -R)
-Subject: Pull request ${url##*/}
+Subject: Pull request ${url##*/}${subject}
-$(git request-pull ${commit} ${url} ${branch})
+${request}
EOF
cat ${tmp}
--- /dev/null
+#!/bin/bash
+
+url="http://git.kernel.org/?p=linux/kernel/git/vapier/blackfin.git;a=commitdiff;h="
+rev=$1
+if [[ -z ${rev} ]] ; then
+ rev=$(git log --pretty='format:%H %s' | sed -n '/LOCAL/{s: .*::;p;q}')
+fi
+
+set -- `git rev-list ${rev}..HEAD`
+
+cat << EOF
+====== Blackfin Linux Kernel Tree Status ======
+
+Last updated at **`date`**
+
+Number of patches in Blackfin tree: **$#**
+EOF
+
+get_status() {
+ local info tid status subj="$*"
+
+ info=$(echo "${subj}" | grep -o '^\[local[^]]*]')
+ info=${info#[} # chop leading [
+ info=${info%]} # chop trailing ]
+ if [[ ${info} == *:* ]] ; then
+ tid=${info#*:} # extract tracker id
+ info=${info%:*} # chop tracker id
+ else
+ tid=
+ fi
+ info=${info#local/} # chop leading "local/"
+ case ${info} in
+ "") status="ready for submission";;
+ LOCAL) status="keep locally forever";;
+ local) status="keep local";;
+ lkml) status="fix LKML feedback";;
+ cleanup) status="needs code/style cleanup";;
+ correct) status="change does not seem to be correct";;
+ dead) status="dead code to be punted";;
+ design) status="waiting for response from hardware design";;
+ generalize) status="needs generalizing/abstracting to avoid #if mess";;
+ no-sob) status="missing Signed-off-by tag from author";;
+ split) status="patch needs to be split";;
+ *) status="keep local (unknown reason '${info}')";;
+ esac
+ [[ -n ${tid} ]] && status="${status}; pending [[bf>tracker/${tid}]]"
+
+ echo "${status}"
+}
+get_patch_info() {
+ if [[ $2 != -b ]] ; then
+ body=$(git log -n1 --stat=100,100 --pretty='format:%b' $r | \
+ sed \
+ -e '/: /s:<.*@.*>:<...>:' \
+ -e '/^Acked-by: /d' \
+ -e '/^Signed-off-by: /d' \
+ -e '/^CC: /d')
+ else
+ body=
+ fi
+ subj=$(git log -n1 --pretty='format:%s' $r)
+ status=$(get_status "${subj}")
+ subj=$(echo "${subj}" | sed 's:^\[local[^]]*] ::')
+}
+
+cat << EOF
+
+===== By Status =====
+EOF
+
+cat << EOF
+
+==== Pending ====
+
+EOF
+for r in "$@" ; do
+ get_patch_info $r -b
+
+ case ${status} in
+ "ready for submission") ;;
+ *) echo " - [[#${subj}]]: ${status}";;
+ esac
+done
+
+cat << EOF
+
+==== Ready ====
+
+EOF
+for r in "$@" ; do
+ get_patch_info $r -b
+
+ case ${status} in
+ "ready for submission") echo " - [[#${subj}]]";;
+ esac
+done
+
+cat << EOF
+
+===== All Patches =====
+
+EOF
+for r in "$@" ; do
+ get_patch_info $r
+
+cat << EOF
+=== ${subj} ===
+
+Status: **${status}**
+
+[[${url}${r}|Commit]]:
+<code>${body}</code>
+
+EOF
+done