]> git.wh0rd.org - home.git/blame - .bin/git-patch-status
add ppc/ppc64 support
[home.git] / .bin / git-patch-status
CommitLineData
8069c098
MF
1#!/bin/bash
2
3url="http://git.kernel.org/?p=linux/kernel/git/vapier/blackfin.git;a=commitdiff;h="
4rev=$1
5if [[ -z ${rev} ]] ; then
6 rev=$(git log --pretty='format:%H %s' | sed -n '/LOCAL/{s: .*::;p;q}')
7fi
8
9set -- `git rev-list ${rev}..HEAD`
10
11cat << EOF
12====== Blackfin Linux Kernel Tree Status ======
13
14Last updated at **`date`**
15
16Number of patches in Blackfin tree: **$#**
17EOF
18
19get_status() {
20 local info tid status subj="$*"
21
22 info=$(echo "${subj}" | grep -o '^\[local[^]]*]')
23 info=${info#[} # chop leading [
24 info=${info%]} # chop trailing ]
25 if [[ ${info} == *:* ]] ; then
26 tid=${info#*:} # extract tracker id
27 info=${info%:*} # chop tracker id
28 else
29 tid=
30 fi
31 info=${info#local/} # chop leading "local/"
32 case ${info} in
33 "") status="ready for submission";;
34 LOCAL) status="keep locally forever";;
35 local) status="keep local";;
36 lkml) status="fix LKML feedback";;
37 cleanup) status="needs code/style cleanup";;
38 correct) status="change does not seem to be correct";;
39 dead) status="dead code to be punted";;
40 design) status="waiting for response from hardware design";;
41 generalize) status="needs generalizing/abstracting to avoid #if mess";;
42 no-sob) status="missing Signed-off-by tag from author";;
43 split) status="patch needs to be split";;
44 *) status="keep local (unknown reason '${info}')";;
45 esac
46 [[ -n ${tid} ]] && status="${status}; pending [[bf>tracker/${tid}]]"
47
48 echo "${status}"
49}
50get_patch_info() {
51 if [[ $2 != -b ]] ; then
52 body=$(git log -n1 --stat=100,100 --pretty='format:%b' $r | \
53 sed \
54 -e '/: /s:<.*@.*>:<...>:' \
55 -e '/^Acked-by: /d' \
56 -e '/^Signed-off-by: /d' \
57 -e '/^CC: /d')
58 else
59 body=
60 fi
61 subj=$(git log -n1 --pretty='format:%s' $r)
62 status=$(get_status "${subj}")
63 subj=$(echo "${subj}" | sed 's:^\[local[^]]*] ::')
64}
65
66cat << EOF
67
68===== By Status =====
69EOF
70
71cat << EOF
72
73==== Pending ====
74
75EOF
76for r in "$@" ; do
77 get_patch_info $r -b
78
79 case ${status} in
80 "ready for submission") ;;
81 *) echo " - [[#${subj}]]: ${status}";;
82 esac
83done
84
85cat << EOF
86
87==== Ready ====
88
89EOF
90for r in "$@" ; do
91 get_patch_info $r -b
92
93 case ${status} in
94 "ready for submission") echo " - [[#${subj}]]";;
95 esac
96done
97
98cat << EOF
99
100===== All Patches =====
101
102EOF
103for r in "$@" ; do
104 get_patch_info $r
105
106cat << EOF
107=== ${subj} ===
108
109Status: **${status}**
110
111[[${url}${r}|Commit]]:
112<code>${body}</code>
113
114EOF
115done