-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadd-rev
executable file
·97 lines (93 loc) · 2.97 KB
/
add-rev
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#!/bin/sh
## Add reviewed-by tag from known people to the right location to the top commit.
update=cat
update='git commit --amend -F -'
me='Reviewed-by: David Sterba <[email protected]>'
itsme=0
if [ -z "$1" -o "$1" = 'me' ]; then
rev="$me"
itsme=1
elif [ "$1" = 'nik' -o "$1" = 'nikbor' ]; then
rev='Reviewed-by: Nikolay Borisov <[email protected]>'
elif [ "$1" = 'nik-tested' -o "$1" = 'nikbor-tested' ]; then
rev='Tested-by: Nikolay Borisov <[email protected]>'
elif [ "$1" = 'anand' ]; then
rev='Reviewed-by: Anand Jain <[email protected]>'
#rev='Tested-by: Anand Jain <[email protected]> # [aarch64]'
elif [ "$1" = 'qu' ]; then
rev='Reviewed-by: Qu Wenruo <[email protected]>'
elif [ "$1" = 'filipe' ]; then
rev='Reviewed-by: Filipe Manana <[email protected]>'
elif [ "$1" = 'liubo' ]; then
rev='Reviewed-by: Liu Bo <[email protected]>'
elif [ "$1" = 'omar' ]; then
rev='Reviewed-by: Omar Sandoval <[email protected]>'
elif [ "$1" = 'su' ]; then
#rev='Reviewed-by: Su Yue <[email protected]>'
rev='Reviewed-by: Su Yue <[email protected]>'
elif [ "$1" = 'misono' ]; then
rev='Reviewed-by: Misono Tomohiro <[email protected]>'
elif [ "$1" = 'lu' ]; then
rev='Reviewed-by: Lu Fengqi <[email protected]>'
elif [ "$1" = 'gu' ]; then
rev='Reviewed-by: Gu Jinxiang <[email protected]>'
elif [ "$1" = 'josef' ]; then
rev='Reviewed-by: Josef Bacik <[email protected]>'
elif [ "$1" = 'johannes' -o "$1" = 'jth' ]; then
rev='Reviewed-by: Johannes Thumshirn <[email protected]>'
elif [ "$1" = 'goldwyn' ]; then
rev='Reviewed-by: Goldwyn Rodrigues <[email protected]>'
elif [ "$1" = 'chaita' ]; then
rev='Reviewed-by: Chaitanya Kulkarni <[email protected]>'
elif [ "$1" = 'hch' ]; then
rev='Reviewed-by: Christoph Hellwig <[email protected]>'
elif [ "$1" = 'ritesh' ]; then
rev='Tested-by: Ritesh Harjani <[email protected]> # [ppc64]'
elif [ "$1" = 'naohiro' ]; then
rev='Reviewed-by: Naohiro Aota <[email protected]>'
elif [ "$1" = 'boris' ]; then
rev='Reviewed-by: Boris Burkov <[email protected]>'
elif [ "$1" = 'stea' -o "$1" = 'tea' ]; then
rev='Reviewed-by: Sweet Tea Dorminy <[email protected]>'
elif [ "$1" = 'djw' -o "$1" = 'darrick' ]; then
rev='Reviewed-by: Darrick J. Wong <[email protected]>'
elif [ "$1" = 'jens' ] ; then
rev='Reviewed-by: Jens Axboe <[email protected]>'
elif [ "$1" = 'mason' ] ; then
rev='Reviewed-by: Chris Mason <[email protected]>'
elif [ "$1" = 'neal' ] ; then
rev='Reviewed-by: Neal Gompa <[email protected]>'
else
echo "ERROR: Unrecognized name: $1"
exit 1
fi
git log --pretty=format:"%s%n%n%b" HEAD^..HEAD |
awk -v tag="$rev" -v itsme="$itsme" -v printed=0 \
'
/Signed-off-by/ {
if ($0 ~/Sterba/) {
if (itsme) {
if (!printed) print tag;
printed=1;
} else {
if (!printed) print tag;
printed=1;
}
} else {
if (itsme) {
} else {
if (!printed) print tag;
printed=1;
}
}
}
/David Sterba/ {
if ($0 ~ /^.igned-off-by:.*Sterba/) {
if (!printed) print tag;
printed=1;
}
}
{
print $0;
}' |
$update