-
Notifications
You must be signed in to change notification settings - Fork 0
/
dsm.sh
executable file
·37 lines (31 loc) · 892 Bytes
/
dsm.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
#!/bin/sh
# Daily Scrum Meeting Reminder
#
# Helps you remind yourself about what you did the last
# working day by printing all commit messages
if [[ -z "$DSM_REMINDER_WORKDIR" ]]; then
echo "Missing environment variable DSM_REMINDER_WORKDIR"
echo "Edit your shell rc file to add:"
echo "export DSM_REMINDER_WORKDIR=~/your_workdir"
exit 1
fi
DAY=$(date +%u)
if [ $DAY == '1' ]; then # Monday
SINCE='3 days'
else
SINCE='1 day'
fi
GIT_NAME=$(git config user.name)
ls -d1 "$DSM_REMINDER_WORKDIR"/*/.git | while read -r REPO_PATH
do
cd "$REPO_PATH"
REPO_NAME=$(echo "$REPO_PATH" | sed "s/\/\.git$//;s/^.*\///")
LOGS=$(git log --all --author "$GIT_NAME" --format=%s --since "$SINCE")
if [ ! -z "$LOGS" ]; then
echo "$REPO_NAME"
echo "$LOGS" | while read -r LOG_LINE
do
echo "\t$LOG_LINE"
done
fi
done