统计分析svn用户每天提交的代码数
·
统计分析svn用户每天提交的代码数
这个脚本可以分析svn 用户每天提交的代码数,有了数量的横向比较,也就知道团队里面哪个成员是有很大的潜力提升,帮助其提高。
可以在这里https://gist.github.com/1297604获取最新的代码,复制黏贴到文件里面,chmod +x 后,即可使用。
使用方法:
像下面,获取上一天某账号改动代码的数量
1 | ./svn_ana.sh SVN_ACCOUNT_NAME | wc -l |
这里也附上代码,使用前将uname, password用你svn账号的用户名、密码替换
01 | #!/bin/sh |
02 | # This is a script that help you get your team member's productivity |
03 | # by analyzing his/her code commiting in SVN repository, for the day before |
04 | # |
05 | # You can get a rough num for comparing between team members by using it in the way below |
06 | # ./svn_ana.sh SVN_ACCOUNT_NAME | wc -l |
07 | # |
08 | uname =vr |
09 | password=reader |
10 |
11 | if [ $ # -lt 1 ] |
12 | then |
13 | echo Usage: $0 ACCOUNT |
14 | echo -e " Where ACCOUNT is the SVN acconut name you want to analyze" |
15 | exit -1 |
16 | fi |
17 | user=$1 |
18 | today=` date +%Y-%m-%d` |
19 | yesterday=` date -d '-1 day' +%Y-%m-%d` |
20 | revisions=$(svn log -r{$today}:{$yesterday} --username $ uname --password $password | grep $user '\ ' | awk '{print $1}' ) |
21 | lastrev=init |
22 | for rawrev in $revisions |
23 | do |
24 | rev=$( echo $rawrev| tr -d r) |
25 | rev2=` expr $rev - 1` |
26 | if [ "$lastrev" = "init" ]; then |
27 | lastrev=$rev |
28 | fi |
29 | dummy=$( echo $revisions| grep $rev2) |
30 | if [ $? - eq 0 ] |
31 | then |
32 | continue |
33 | fi |
34 |
35 | svn diff -r$rev2:$lastrev --username $ uname --password $password |
36 | lastrev=init |
37 | done |
更多推荐
已为社区贡献3条内容
所有评论(0)