mirror of
https://github.com/git-quick-stats/git-quick-stats.git
synced 2025-12-16 12:00:12 +01:00
Compare commits
15 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8bfc58710a | ||
|
|
6f931ac9b5 | ||
|
|
42a657b0de | ||
|
|
a48347e0df | ||
|
|
f4930f152d | ||
|
|
e5727cf4e9 | ||
|
|
6b54e9d8df | ||
|
|
7f70c8b728 | ||
|
|
dc86f8b6ae | ||
|
|
36967bc6f4 | ||
|
|
cdfa6bf467 | ||
|
|
a496390884 | ||
|
|
e81d3ab9f4 | ||
|
|
b0e62d64c7 | ||
|
|
01b6e17007 |
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017 Lukáš Mešťan
|
||||
Copyright (c) 2018 Lukáš Mešťan
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
5
Makefile
5
Makefile
@@ -1,4 +1,4 @@
|
||||
PREFIX=/usr/local
|
||||
PREFIX ?= /usr/local
|
||||
TASK_DONE = echo -e "\n✓ $@ done\n"
|
||||
# files that need mode 755
|
||||
EXEC_FILES=git-quick-stats
|
||||
@@ -16,7 +16,8 @@ help:
|
||||
@$(TASK_DONE)
|
||||
|
||||
install:
|
||||
install -m 0755 $(EXEC_FILES) $(PREFIX)/bin
|
||||
mkdir -p $(PREFIX)/bin
|
||||
install -m 0755 $(EXEC_FILES) $(PREFIX)/bin/$(EXEC_FILES)
|
||||
git config --global alias.quick-stats '! $(PREFIX)/bin/$(EXEC_FILES)'
|
||||
@$(TASK_DONE)
|
||||
|
||||
|
||||
28
README.md
28
README.md
@@ -1,13 +1,13 @@
|
||||
|
||||
## GIT quick statistics
|
||||
## GIT quick statistics [](https://twitter.com/intent/tweet?text=Simple%20and%20efficient%20way%20to%20access%20various%20statistics%20in%20git%20repository&url=https://github.com/arzzen/git-quick-stat&via=arzzen&hashtags=git,stats,tool,statistics,developers)
|
||||
|
||||
[](https://travis-ci.org/arzzen/git-quick-stats)
|
||||
[](https://travis-ci.org/arzzen/git-quick-stats)
|
||||
[](http://braumeister.org/formula/git-quick-stats)
|
||||
[](https://repology.org/metapackage/git-quick-stats/packages)
|
||||
|
||||
> `git quick-stats` is a simple and efficient way to access various statistics in git repository.
|
||||
|
||||
> Any git repository contains a tonne of information about commits, contributors, and files. Extracting this information is not always trivial, mostly because of a gadzillion options to a gadzillion git commands – I don’t think there is a single person alive who knows them all. Probably not even [Linus Torvalds](https://github.com/torvalds) himself :).
|
||||
> Any git repository contains tons of information about commits, contributors, and files. Extracting this information is not always trivial, mostly because of a gadzillion options to a gadzillion git commands – I don’t think there is a single person alive who knows them all. Probably not even [Linus Torvalds](https://github.com/torvalds) himself :).
|
||||
|
||||
## Table of Contents
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* [**Windows**](#windows-cygwin)
|
||||
|
||||
[**Usage**](#usage)
|
||||
* [**Git log since/unitl**](#git-log-since-until)
|
||||
* [**Git log since/until**](#git-log-since-until)
|
||||
* [**Git log limit**](#git-log-limit)
|
||||
* [**Git pathspec**](#git-pathspec)
|
||||
* [**Tests**](#tests)
|
||||
@@ -29,6 +29,8 @@
|
||||
|
||||
[**Contribution**](#contribution)
|
||||
|
||||
[**FAQ**](#faq)
|
||||
|
||||
[**License**](#licensing)
|
||||
|
||||
|
||||
@@ -49,7 +51,7 @@
|
||||
|
||||
```bash
|
||||
git quick-stats
|
||||
# or
|
||||
# or
|
||||
git-quick-stats
|
||||
```
|
||||
|
||||
@@ -57,7 +59,7 @@ Or you can use (non-interactive) direct execution:
|
||||
|
||||
`git quick-stats <optional-command-to-execute-directly>`
|
||||
|
||||
Possible arguments:
|
||||
Possible arguments:
|
||||
> suggestReviewers, detailedGitStats, commitsByHour, commitsByWeekday, commitsByMonth, commitsPerDay, commitsPerAuthor, myDailyStats, contributors,
|
||||
branchTree, branchesByDate, changelogs, changelogsByAuthor
|
||||
|
||||
@@ -74,7 +76,7 @@ export _GIT_UNTIL="2017-22-01"
|
||||
then run `git quick-stats` (affect all stats, except "My daily status" and "Git changelogs" )
|
||||
|
||||
|
||||
#### Git log limit
|
||||
#### Git log limit
|
||||
|
||||
You can set variable `_GIT_LIMIT` for limited output (it will affect: "Git changelogs" and "Branch tree view" )
|
||||
|
||||
@@ -120,7 +122,7 @@ brew install git-quick-stats
|
||||
|
||||
#### Windows (cygwin)
|
||||
|
||||
* [installer](https://gist.github.com/arzzen/35e09866dfdadf2108b2420045739245)
|
||||
* [installer](https://gist.github.com/arzzen/35e09866dfdadf2108b2420045739245)
|
||||
* [uninstaller](https://gist.github.com/arzzen/21c660014d0663b6c5710014714779d6)
|
||||
|
||||
|
||||
@@ -133,12 +135,18 @@ brew install git-quick-stats
|
||||
|
||||
* [`bsdmainutils`](https://packages.debian.org/sid/bsdmainutils) `apt install bsdmainutils`
|
||||
|
||||
## Contribution
|
||||
## FAQ
|
||||
|
||||
*Q:* I get some errors after run git-quick-stats in cygwin like `/usr/local/bin/git-quick-stats: line 2: $'\r': command not found`
|
||||
|
||||
*A:* You can run dos2unix app in cygwin `/bin/dos2unix.exe /usr/local/bin/git-quick-stats`. This will convert it to Unix format and you then should be able to run it.
|
||||
|
||||
## Contribution
|
||||
|
||||
Want to contribute? Great! First, read this page.
|
||||
|
||||
#### Code reviews
|
||||
All submissions, including submissions by project members, require review.
|
||||
All submissions, including submissions by project members, require review.
|
||||
We use Github pull requests for this purpose.
|
||||
|
||||
#### Some tips for good pull requests:
|
||||
|
||||
@@ -97,7 +97,8 @@ function detailedGitStats() {
|
||||
}
|
||||
|
||||
/^Author:/ {
|
||||
author = $2 " " $3
|
||||
$1 = ""
|
||||
author = $0
|
||||
commits[author] += 1
|
||||
commits["total"] += 1
|
||||
}
|
||||
@@ -204,7 +205,7 @@ function commitsByHour() {
|
||||
for i in `seq -w 0 23`
|
||||
do
|
||||
echo -ne "\t$i\t"
|
||||
echo $(git shortlog -n --no-merges --format='%ad %s' $_author $_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
|
||||
@@ -277,10 +278,10 @@ function changelogs() {
|
||||
fi
|
||||
|
||||
NEXT=$(date +%F)
|
||||
git log --use-mailmap --no-merges --format="%cd" --date=short $_author $_since $_until $_pathspec | sort -u -r | head -n $_limit | while read DATE ; do
|
||||
git log --use-mailmap --no-merges --format="%cd" --date=short "$_author" $_since $_until $_pathspec | sort -u -r | head -n $_limit | while read DATE ; do
|
||||
echo
|
||||
echo "[$DATE]"
|
||||
GIT_PAGER=cat git log --use-mailmap --no-merges --format=" * %s (%aN)" $_author --since=$DATE --until=$NEXT
|
||||
GIT_PAGER=cat git log --use-mailmap --no-merges --format=" * %s (%aN)" "$_author" --since=$DATE --until=$NEXT
|
||||
NEXT=$DATE
|
||||
done
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user