]> git.wh0rd.org - home.git/blame - .bin/git-patch-status
cros-board: update
[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";;
d33ba63f 42 log) status="needs better change log";;
8069c098
MF
43 no-sob) status="missing Signed-off-by tag from author";;
44 split) status="patch needs to be split";;
45 *) status="keep local (unknown reason '${info}')";;
46 esac
47 [[ -n ${tid} ]] && status="${status}; pending [[bf>tracker/${tid}]]"
48
49 echo "${status}"
50}
51get_patch_info() {
52 if [[ $2 != -b ]] ; then
53 body=$(git log -n1 --stat=100,100 --pretty='format:%b' $r | \
54 sed \
55 -e '/: /s:<.*@.*>:<...>:' \
56 -e '/^Acked-by: /d' \
57 -e '/^Signed-off-by: /d' \
58 -e '/^CC: /d')
59 else
60 body=
61 fi
62 subj=$(git log -n1 --pretty='format:%s' $r)
63 status=$(get_status "${subj}")
64 subj=$(echo "${subj}" | sed 's:^\[local[^]]*] ::')
65}
66
67cat << EOF
68
69===== By Status =====
70EOF
71
72cat << EOF
73
74==== Pending ====
75
76EOF
77for r in "$@" ; do
78 get_patch_info $r -b
79
80 case ${status} in
81 "ready for submission") ;;
82 *) echo " - [[#${subj}]]: ${status}";;
83 esac
84done
85
86cat << EOF
87
88==== Ready ====
89
90EOF
91for r in "$@" ; do
92 get_patch_info $r -b
93
94 case ${status} in
95 "ready for submission") echo " - [[#${subj}]]";;
96 esac
97done
98
99cat << EOF
100
101===== All Patches =====
102
103EOF
104for r in "$@" ; do
105 get_patch_info $r
106
107cat << EOF
108=== ${subj} ===
109
110Status: **${status}**
111
112[[${url}${r}|Commit]]:
113<code>${body}</code>
114
115EOF
116done