Compare commits

..

4 Commits
1.0.4 ... 1.0.5

Author SHA1 Message Date
Lukas Mestan
d2fe6fe5ce bugfix tree view 2017-03-18 12:09:17 +01:00
Lukáš Mešťan
8f5dd5bed7 Merge pull request #26 from bpkroth/add-commitsByAuthorByHour-support 2017-03-18 12:06:21 +01:00
Brian Kroth
d4f09f23be adapts commitsByHour to allow reporting by author as well 2017-03-17 10:53:25 -05:00
Lukáš Mešťan
89a62ebe06 remove dot in pathspec 2017-03-17 07:30:29 +01:00

View File

@@ -15,7 +15,7 @@ fi
_pathspec=${_GIT_PATHSPEC:-}
if [ ! -z "${_pathspec}" ]
then _pathspec="-- . $_pathspec"
then _pathspec="-- $_pathspec"
fi
_limit=${_GIT_LIMIT:-}
@@ -47,8 +47,9 @@ show_menu() {
echo -e "${MENU} ${NUMBER} 9)${MENU} Git commits per month ${NORMAL}"
echo -e "${MENU} ${NUMBER} 10)${MENU} Git commits per weekday ${NORMAL}"
echo -e "${MENU} ${NUMBER} 11)${MENU} Git commits per hour ${NORMAL}"
echo -e "${MENU} ${NUMBER} 12)${MENU} Git commits by author per hour ${NORMAL}"
echo -e "${RED_TEXT} Suggest: ${NORMAL}"
echo -e "${MENU} ${NUMBER} 12)${MENU} Code reviewers (based on git history) ${NORMAL}"
echo -e "${MENU} ${NUMBER} 13)${MENU} Code reviewers (based on git history) ${NORMAL}"
echo -e ""
echo -e "${ENTER_LINE}Please enter a menu option or ${RED_TEXT}press enter to exit. ${NORMAL}"
read opt
@@ -190,12 +191,19 @@ function commitsByWeekday() {
}
function commitsByHour() {
option_picked "Git commits by hour:"
local author="${1:-}"
local _author=''
if [ -z "$author" ]; then
option_picked "Git commits by hour:"
else
option_picked "Git commits by hour for author '$author':"
_author="--author=$author"
fi
echo -e "\thour\tsum"
for i in `seq -w 0 23`
do
echo -ne "\t$i\t"
echo $(git shortlog -n --no-merges --format='%ad %s' $_since $_until | grep " $i:" | wc -l)
echo $(git shortlog -n --no-merges --format='%ad %s' $_author $_since $_until | grep " $i:" | wc -l)
done | awk '{
count[$1] = $2
total += $2
@@ -248,7 +256,7 @@ function contributors() {
function branchTree() {
option_picked "Branching tree view:"
git log --graph --abbrev-commit $_since $_until --decorate --format=format:'--+ Commit: %h %n | Date: %aD (%ar) %n'' | Message: %s %d %n'' + Author: %an %n' --all $_exclude | head -n $((_limit*5))
git log --graph --abbrev-commit $_since $_until --decorate --format=format:'--+ Commit: %h %n | Date: %aD (%ar) %n'' | Message: %s %d %n'' + Author: %an %n' --all | head -n $((_limit*5))
}
@@ -308,11 +316,16 @@ if [ $# -eq 1 ]
"commitsByHour")
commitsByHour
;;
"commitsByAuthorByHour")
author="${_GIT_AUTHOR:-}"
while [ -z "$author" ]; do read -p "Which author? " author; done
commitsByHour "$author"
;;
"commitsByMonth")
commitsByMonth
;;
*)
echo "Invalid argument. Possible arguments: suggestReviewers, detailedGitStats, commitsPerDay, commitsByMonth, commitsByWeekday, commitsByHour, commitsPerAuthor, myDailyStats, contributors, branchTree, branchesByDate, changelogs"
echo "Invalid argument. Possible arguments: suggestReviewers, detailedGitStats, commitsPerDay, commitsByMonth, commitsByWeekday, commitsByHour, commitsByAuthorByHour, commitsPerAuthor, myDailyStats, contributors, branchTree, branchesByDate, changelogs"
;;
esac
exit 0;
@@ -379,6 +392,12 @@ while [ opt != '' ]
show_menu
;;
12)
author=''
while [ -z "$author" ]; do read -p "Which author? " author; done
commitsByHour "$author"
show_menu
;;
13)
suggestReviewers
show_menu
;;