-
Notifications
You must be signed in to change notification settings - Fork 0
/
permissions
executable file
·59 lines (46 loc) · 1.4 KB
/
permissions
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
#!/bin/sh
. legit-setup.sh
user=$(git config user.email)
user=${user//@/_}
if ! test -n "$user"
then
die "fatal: no user was found. Set one in git config"
fi
cd_to_toplevel
git checkout tracking -- .tracking/config
git checkout tracking -- .tracking/users/$user
if [ $? != 0 ]
then
die "fatal: The user isn't in the system"
fi
read_required_values $1
file=".tracking/users/$user"
proposals=$(read_header proposals $file)
accepted=$(read_header accepted $file)
rejected=$(read_header rejected $file)
reviews=$(read_header reviews $file)
bad_accepts=$(read_header bad-accepts $file)
bad_rejects=$(read_header bad-rejects $file)
good_accepts=$(read_header good-accepts $file)
good_rejects=$(read_header good-rejects $file)
can_do=false
do_test()
{
header=$1
value=$2
threshold=$3
if test $value -lt $threshold
then
die "Fatal: Not enough $header"
fi
}
do_test "Total Proposals" $proposals $req_total_proposals
do_test "Proposals" $(expr $accepted - $rejected) $req_proposals
do_test "Accepted Proposals" $accepted $req_accepted
good_reviews=$(expr $good_accepts + $good_rejects)
bad_reviews=$(expr $bad_accepts + $bad_rejects)
do_test "Total Reviews" $reviews $req_total_reviews
do_test "Reviews" $(expr $good_reviews - $bad_reviews) $req_reviews
do_test "Good Accepts" $good_accepts $req_good_accepts
do_test "Good Rejects" $good_rejects $req_good_rejects
git rm --quiet -f -r .tracking