Compare commits

...

15 Commits

Author SHA1 Message Date
Lukáš Mešťan
8bfc58710a Merge pull request #47 from mixn/master
Fixes minor typos
2018-09-28 11:46:59 +02:00
mixn
6f931ac9b5 Fixes minor typos 2018-09-27 13:56:19 +02:00
Lukáš Mešťan
42a657b0de Merge pull request #45 from thangdc94/thangdc94-patch-1
fix: author not show fullname in contribution stats
2018-09-21 08:55:32 +02:00
Lukáš Mešťan
a48347e0df Merge pull request #46 from mathstuf/fix-install-to-empty-prefix
Makefile: fix installing to an empty prefix
2018-09-21 08:52:09 +02:00
Ben Boeckel
f4930f152d Makefile: fix installing to an empty prefix
If `$(PREFIX)` was an empty directory, `$(PREFIX)/bin` would end up
being the executable instead of a directory. Create the `bin` directory
first.
2018-09-20 13:34:18 -04:00
Phạm Ngọc Thắng
e5727cf4e9 fix: author not show fullname 2018-09-19 10:17:16 +07:00
Lukáš Mešťan
6b54e9d8df Merge pull request #44 from dkalowsk/fix_makefile
Makefile: set PREFIX to conditional assignment
2018-08-23 09:32:17 +02:00
Dan Kalowsky
7f70c8b728 Makefile: set PREFIX to conditional assignment
When the variable PREFIX is provided on the command line, do not
override the value.

Signed-off-by: Dan Kalowsky <dank@deadmime.org>
2018-08-22 14:37:11 -07:00
Lukáš Mešťan
dc86f8b6ae Merge pull request #43 from afarah1/master
Fix ambiguous argument when author is not specified for commits by hour
2018-07-26 10:56:39 +02:00
Alef Farah
36967bc6f4 Fix ambiguous argument when author is not specified 2018-07-25 18:38:37 -03:00
Lukáš Mešťan
cdfa6bf467 Merge pull request #42 from RobertBeilich/master
Fix error on whitespace in author name
2018-07-17 16:34:43 +02:00
Robert Beilich
a496390884 Fix error on whitespace in author name
Fixes https://github.com/arzzen/git-quick-stats/issues/37
2018-07-17 09:42:39 +02:00
Lukáš Mešťan
e81d3ab9f4 Update README.md 2018-01-22 20:15:45 +01:00
Lukáš Mešťan
b0e62d64c7 Update README.md 2018-01-22 08:25:42 +01:00
Lukáš Mešťan
01b6e17007 Update LICENSE 2018-01-07 12:33:34 +01:00
4 changed files with 27 additions and 17 deletions

View File

@@ -1,6 +1,6 @@
MIT License 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 Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@@ -1,4 +1,4 @@
PREFIX=/usr/local PREFIX ?= /usr/local
TASK_DONE = echo -e "\n✓ $@ done\n" TASK_DONE = echo -e "\n✓ $@ done\n"
# files that need mode 755 # files that need mode 755
EXEC_FILES=git-quick-stats EXEC_FILES=git-quick-stats
@@ -16,7 +16,8 @@ help:
@$(TASK_DONE) @$(TASK_DONE)
install: 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)' git config --global alias.quick-stats '! $(PREFIX)/bin/$(EXEC_FILES)'
@$(TASK_DONE) @$(TASK_DONE)

View File

@@ -1,13 +1,13 @@
## GIT quick statistics ## GIT quick statistics [![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](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)
[![Travis](https://api.travis-ci.org/arzzen/git-quick-stats.svg?branch=master)](https://travis-ci.org/arzzen/git-quick-stats) [![Travis](https://api.travis-ci.org/arzzen/git-quick-stats.svg?branch=master)](https://travis-ci.org/arzzen/git-quick-stats)
[![Homebrew package](https://repology.org/badge/version-for-repo/homebrew/git-quick-stats.svg)](http://braumeister.org/formula/git-quick-stats) [![Homebrew package](https://repology.org/badge/version-for-repo/homebrew/git-quick-stats.svg)](http://braumeister.org/formula/git-quick-stats)
[![Linuxbrew package](https://repology.org/badge/version-for-repo/linuxbrew/git-quick-stats.svg)](https://repology.org/metapackage/git-quick-stats/packages) [![Linuxbrew package](https://repology.org/badge/version-for-repo/linuxbrew/git-quick-stats.svg)](https://repology.org/metapackage/git-quick-stats/packages)
> `git quick-stats` is a simple and efficient way to access various statistics in git repository. > `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 dont 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 dont think there is a single person alive who knows them all. Probably not even [Linus Torvalds](https://github.com/torvalds) himself :).
## Table of Contents ## Table of Contents
@@ -19,7 +19,7 @@
* [**Windows**](#windows-cygwin) * [**Windows**](#windows-cygwin)
[**Usage**](#usage) [**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 log limit**](#git-log-limit)
* [**Git pathspec**](#git-pathspec) * [**Git pathspec**](#git-pathspec)
* [**Tests**](#tests) * [**Tests**](#tests)
@@ -29,6 +29,8 @@
[**Contribution**](#contribution) [**Contribution**](#contribution)
[**FAQ**](#faq)
[**License**](#licensing) [**License**](#licensing)
@@ -49,7 +51,7 @@
```bash ```bash
git quick-stats git quick-stats
# or # or
git-quick-stats git-quick-stats
``` ```
@@ -57,7 +59,7 @@ Or you can use (non-interactive) direct execution:
`git quick-stats <optional-command-to-execute-directly>` `git quick-stats <optional-command-to-execute-directly>`
Possible arguments: Possible arguments:
> suggestReviewers, detailedGitStats, commitsByHour, commitsByWeekday, commitsByMonth, commitsPerDay, commitsPerAuthor, myDailyStats, contributors, > suggestReviewers, detailedGitStats, commitsByHour, commitsByWeekday, commitsByMonth, commitsPerDay, commitsPerAuthor, myDailyStats, contributors,
branchTree, branchesByDate, changelogs, changelogsByAuthor 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" ) 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" ) 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) #### Windows (cygwin)
* [installer](https://gist.github.com/arzzen/35e09866dfdadf2108b2420045739245) * [installer](https://gist.github.com/arzzen/35e09866dfdadf2108b2420045739245)
* [uninstaller](https://gist.github.com/arzzen/21c660014d0663b6c5710014714779d6) * [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` * [`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. Want to contribute? Great! First, read this page.
#### Code reviews #### 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. We use Github pull requests for this purpose.
#### Some tips for good pull requests: #### Some tips for good pull requests:

View File

@@ -97,7 +97,8 @@ function detailedGitStats() {
} }
/^Author:/ { /^Author:/ {
author = $2 " " $3 $1 = ""
author = $0
commits[author] += 1 commits[author] += 1
commits["total"] += 1 commits["total"] += 1
} }
@@ -204,7 +205,7 @@ function commitsByHour() {
for i in `seq -w 0 23` for i in `seq -w 0 23`
do do
echo -ne "\t$i\t" 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 '{ done | awk '{
count[$1] = $2 count[$1] = $2
total += $2 total += $2
@@ -277,10 +278,10 @@ function changelogs() {
fi fi
NEXT=$(date +%F) 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
echo "[$DATE]" 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 NEXT=$DATE
done done
} }