]> git.wh0rd.org - home.git/blob - .bin/git-patch-status
more bin scripts
[home.git] / .bin / git-patch-status
1 #!/bin/bash
2
3 url="http://git.kernel.org/?p=linux/kernel/git/vapier/blackfin.git;a=commitdiff;h="
4 rev=$1
5 if [[ -z ${rev} ]] ; then
6 rev=$(git log --pretty='format:%H %s' | sed -n '/LOCAL/{s: .*::;p;q}')
7 fi
8
9 set -- `git rev-list ${rev}..HEAD`
10
11 cat << EOF
12 ====== Blackfin Linux Kernel Tree Status ======
13
14 Last updated at **`date`**
15
16 Number of patches in Blackfin tree: **$#**
17 EOF
18
19 get_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 }
50 get_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
66 cat << EOF
67
68 ===== By Status =====
69 EOF
70
71 cat << EOF
72
73 ==== Pending ====
74
75 EOF
76 for r in "$@" ; do
77 get_patch_info $r -b
78
79 case ${status} in
80 "ready for submission") ;;
81 *) echo " - [[#${subj}]]: ${status}";;
82 esac
83 done
84
85 cat << EOF
86
87 ==== Ready ====
88
89 EOF
90 for r in "$@" ; do
91 get_patch_info $r -b
92
93 case ${status} in
94 "ready for submission") echo " - [[#${subj}]]";;
95 esac
96 done
97
98 cat << EOF
99
100 ===== All Patches =====
101
102 EOF
103 for r in "$@" ; do
104 get_patch_info $r
105
106 cat << EOF
107 === ${subj} ===
108
109 Status: **${status}**
110
111 [[${url}${r}|Commit]]:
112 <code>${body}</code>
113
114 EOF
115 done