#!/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";; log) status="needs better change log";; 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]]: ${body} EOF done