mirror of
https://github.com/git-quick-stats/git-quick-stats.git
synced 2025-12-16 12:00:12 +01:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5a55f87ad7 | ||
|
|
11c1a9ff5c | ||
|
|
06563a2170 | ||
|
|
2e9b163766 | ||
|
|
8558eef324 |
21
README.md
21
README.md
@@ -32,6 +32,8 @@ Or you can use (non-interactive) direct execution:
|
||||
branchTree, branchesByDate, changelogs
|
||||
|
||||
|
||||
#### Git log --since and --until arguments
|
||||
|
||||
You can set variable `_GIT_SINCE`, `_GIT_UNTIL` and limit the git log
|
||||
|
||||
eg:
|
||||
@@ -42,8 +44,20 @@ eg:
|
||||
|
||||
then run `git quick-stats` (affect all stats, except "My daily status" and "Git changelogs" )
|
||||
|
||||
|
||||
#### Git log limit
|
||||
|
||||
You can set variable `_GIT_LIMIT` for limited output (it will affect: "Git changelogs" and "Branch tree view" )
|
||||
|
||||
eg:
|
||||
|
||||
`export _GIT_LIMIT=20`
|
||||
|
||||
|
||||
## Installation
|
||||
|
||||
#### Unix like OS
|
||||
|
||||
```
|
||||
git clone https://github.com/arzzen/git-quick-stats.git && cd git-quick-stats
|
||||
sudo make install
|
||||
@@ -55,11 +69,16 @@ For uninstalling, open up the cloned directory and run
|
||||
sudo make uninstall
|
||||
```
|
||||
|
||||
#### Cygwin installation
|
||||
#### OS X (homebrew)
|
||||
|
||||
`brew install git-quick-stats`
|
||||
|
||||
#### Windows (cygwin)
|
||||
|
||||
* [installer](https://gist.github.com/arzzen/35e09866dfdadf2108b2420045739245)
|
||||
* [uninstaller](https://gist.github.com/arzzen/21c660014d0663b6c5710014714779d6)
|
||||
|
||||
|
||||
## System requirements
|
||||
|
||||
* Unix like OS with a proper shell
|
||||
|
||||
@@ -13,6 +13,13 @@ if [ ! -z ${_until} ]
|
||||
then _until="--until=$_until"
|
||||
fi
|
||||
|
||||
_limit=${_GIT_LIMIT:-}
|
||||
if [ ! -z ${_limit} ]
|
||||
then _limit=$_limit
|
||||
else
|
||||
_limit=10
|
||||
fi
|
||||
|
||||
show_menu() {
|
||||
NORMAL=`echo "\033[m"`
|
||||
MENU=`echo "\033[36m"`
|
||||
@@ -24,10 +31,10 @@ show_menu() {
|
||||
echo -e ""
|
||||
echo -e "${RED_TEXT} Generate: ${NORMAL}"
|
||||
echo -e "${MENU} ${NUMBER} 1)${MENU} Contribution stats (by author) ${NORMAL}"
|
||||
echo -e "${MENU} ${NUMBER} 2)${MENU} Git changelogs ${NORMAL}"
|
||||
echo -e "${MENU} ${NUMBER} 2)${MENU} Git changelogs (last $_limit)${NORMAL}"
|
||||
echo -e "${MENU} ${NUMBER} 3)${MENU} My daily status ${NORMAL}"
|
||||
echo -e "${RED_TEXT} List: ${NORMAL}"
|
||||
echo -e "${MENU} ${NUMBER} 4)${MENU} Branch tree view (last 10)${NORMAL}"
|
||||
echo -e "${MENU} ${NUMBER} 4)${MENU} Branch tree view (last $_limit)${NORMAL}"
|
||||
echo -e "${MENU} ${NUMBER} 5)${MENU} All branches (sorted by most recent commit) ${NORMAL}"
|
||||
echo -e "${MENU} ${NUMBER} 6)${MENU} All contributors (sorted by name) ${NORMAL}"
|
||||
echo -e "${MENU} ${NUMBER} 7)${MENU} Git commits per author ${NORMAL}"
|
||||
@@ -154,9 +161,9 @@ function commitsByWeekday() {
|
||||
do
|
||||
echo -en "\t$i\t"
|
||||
echo $(git shortlog -n --no-merges --format='%ad %s' $_since $_until | grep "$i " | wc -l)
|
||||
done | awk '{
|
||||
|
||||
}
|
||||
done | awk '{
|
||||
|
||||
}
|
||||
NR == FNR {
|
||||
count[$1] = $2;
|
||||
total += $2;
|
||||
@@ -233,7 +240,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 | head -n 50
|
||||
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))
|
||||
}
|
||||
|
||||
|
||||
@@ -244,7 +251,14 @@ function branchesByDate() {
|
||||
|
||||
function changelogs() {
|
||||
option_picked "Git changelogs:"
|
||||
git log --pretty=format:"- %s%n%b" --since="$(git show -s --format=%ad `git rev-list --all --max-count=1`)" | sort -nr
|
||||
NEXT=$(date +%F)
|
||||
|
||||
git log --no-merges --format="%cd" --date=short $_since $_until | sort -u -r | head -n $_limit | while read DATE ; do
|
||||
echo
|
||||
echo "[$DATE]"
|
||||
GIT_PAGER=cat git log --no-merges --format=" * %s" --since=$DATE --until=$NEXT
|
||||
NEXT=$DATE
|
||||
done
|
||||
}
|
||||
|
||||
# Check if we are currently in a git repo.
|
||||
@@ -330,7 +344,7 @@ while [ opt != '' ]
|
||||
;;
|
||||
5)
|
||||
branchesByDate
|
||||
show_menu
|
||||
show_menu
|
||||
;;
|
||||
6)
|
||||
contributors
|
||||
@@ -361,13 +375,13 @@ while [ opt != '' ]
|
||||
show_menu
|
||||
;;
|
||||
q)
|
||||
exit
|
||||
exit
|
||||
;;
|
||||
\n)
|
||||
exit
|
||||
exit
|
||||
;;
|
||||
*)
|
||||
clear
|
||||
clear
|
||||
option_picked "Pick an option from the menu"
|
||||
show_menu
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user