-
Notifications
You must be signed in to change notification settings - Fork 1
/
timesheet.sh
45 lines (36 loc) · 1 KB
/
timesheet.sh
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
# Your email or your username
ME="[email protected]"
# Yesterday timesheet
function getMeYesterdayGit {
git log --pretty="%s" --author=$1 --until="1.days" --since="2.days" | grep -e '#'
}
function getOthersYesterdayGit {
git log --pretty="%s" --invert-grep --author=$1 --until="1.days" --since="2.days" | grep -e '#'
}
function getYesterdayTimesheet {
ME_CODE=$(getMeYesterdayGit $ME);
OTH_CODE=$(getOthersYesterdayGit $ME);
echo "Code";
echo $ME_CODE;
echo '';
echo "Code Review";
echo $OTH_CODE;
}
# Today timesheet
function getOthersTodayGit {
git log --pretty="%s" --invert-grep --author=$1 --since="1.days" | grep -e '#'
}
function getMeTodayGit {
git log --pretty="%s" --author=$1 --since="1.days" | grep -e '#'
}
function getTimesheet {
ME_CODE=$(getMeTodayGit $ME);
OTH_CODE=$(getOthersTodayGit $ME);
echo "Code";
echo $ME_CODE;
echo '';
echo "Code Review";
echo $OTH_CODE;
}
alias timesheet='getTimesheet'
alias timesheet-yest='getYesterdayTimesheet'