Skip to content
This repository has been archived by the owner on Jun 13, 2018. It is now read-only.

Commit

Permalink
fixing --summary, now it supports more log params
Browse files Browse the repository at this point in the history
  • Loading branch information
edulix committed Dec 3, 2010
1 parent f0e229f commit ff73861
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions git-timetrack
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ function current_time() {
function user_time_dedication() {
user=$1
shift
alltimes=$(git log $* --author="$user" | grep "Time-spent: " | cut -d":" -f2)
alltimes=$(git log --author="$user" $* | grep "Time-spent: " | cut -d":" -f2)

total=0
for t in $alltimes
Expand Down Expand Up @@ -160,7 +160,7 @@ case $1 in

-u|--summary)
shift
allusers=$(git log $* --oneline --pretty="format: %an <%ae>" | sort | uniq)
allusers=$(git log --oneline --pretty="format: %an <%ae>" $* | sort | uniq)
alltimes=$(git log $* | grep "Time-spent:" | cut -d":" -f2)

total=0
Expand All @@ -172,8 +172,8 @@ case $1 in
echo "total time spent by authors"
printf "$allusers\n" | while read author
do
dedication="$(human_time $(user_time_dedication "$author" $*))"
[ "$dedication" ] && printf " %-49s %s\n" "$author" "$dedication"
dedication=$(user_time_dedication "$author" $*)
[ $dedication -ne 0 ] && printf " %-49s %s\n" "$author" "$(human_time $dedication)"
done

printf "\n%-50s %s\n" "total time spent in this project" "$(human_time $total)"
Expand Down

0 comments on commit ff73861

Please sign in to comment.