Compare commits

...

31 Commits

Author SHA1 Message Date
Lukáš Mešťan
08520bf068 Merge pull request #48 from danieltaub96/master
fixed  Git changelogs wont work
2018-11-05 21:40:36 +01:00
Daniel
374527dbe1 changelogs printed with days limit 2018-11-05 20:45:01 +02:00
Daniel
dba2d87206 fixed git changelogs without author wont work 2018-11-05 20:40:13 +02:00
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
Lukáš Mešťan
ac730dbfbc Merge pull request #36 from a7r3/master
Makefile: Don't treat newline characters literally
2017-10-20 08:20:50 +02:00
a7r3
37b37bb5c8 Makefile: Don't treat newline characters literally
Signed-off-by: a7r3 <arvindultimate7352@gmail.com>
2017-10-19 22:04:33 +05:30
Lukáš Mešťan
db8009ff6d Update README.md 2017-09-29 13:41:25 +02:00
Lukáš Mešťan
5a275c87b8 Delete CONTRIBUTING.md 2017-09-29 13:40:28 +02:00
Lukáš Mešťan
98c0252e97 Rename CONTRIBUTING.md to contributing.md 2017-09-29 13:40:15 +02:00
Lukáš Mešťan
5a389f5071 Create issue_template.md 2017-09-29 13:38:57 +02:00
Lukáš Mešťan
382f6759cf Create CONTRIBUTING.md 2017-09-29 13:37:36 +02:00
Lukáš Mešťan
6362149953 Update README.md 2017-09-29 13:33:00 +02:00
Lukáš Mešťan
36cae305a4 Update .travis.yml 2017-09-29 13:28:50 +02:00
Lukáš Mešťan
90f6b631a9 update badges 2017-09-11 15:53:31 +02:00
Lukáš Mešťan
6a894d9efe Update README.md 2017-09-11 15:51:12 +02:00
Lukas Mestan
ef6120fa64 add .mailmap 2017-09-05 08:42:41 +02:00
Lukas Mestan
7c6b9b01e4 update makefile 2017-09-04 12:01:34 +02:00
8 changed files with 93 additions and 28 deletions

3
.mailmap Normal file
View File

@@ -0,0 +1,3 @@
Lukas Mestan <lukas.mestan@gmail.com> Lukáš Mešťan <arzzen@users.noreply.github.com>
Lukas Mestan <lukas.mestan@gmail.com> arzzen

View File

@@ -1,2 +1,34 @@
language: bash
language: generic
sudo: required
addons:
apt:
packages:
- libcurl4-openssl-dev
- libelf-dev
- libdw-dev
- cmake
install:
- git checkout ${TRAVIS_PULL_REQUEST_BRANCH:-$TRAVIS_BRANCH}
- git branch --set-upstream-to origin/$TRAVIS_BRANCH
- git rev-parse HEAD
script: make test
after_success: |
wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz &&
tar xzf master.tar.gz &&
cd kcov-master &&
mkdir build &&
cd build &&
cmake .. &&
make &&
sudo make install &&
cd ../.. &&
rm -rf kcov-master &&
mkdir -p coverage &&
kcov coverage git-quick-stats suggestReviewers && bash <(curl -s https://codecov.io/bash) -cF suggestReviewers &&
kcov coverage git-quick-stats detailedGitStats && bash <(curl -s https://codecov.io/bash) -cF detailedGitStats &&
kcov coverage git-quick-stats commitsPerDay && bash <(curl -s https://codecov.io/bash) -cF commitsPerDay

View File

@@ -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

View File

@@ -1,8 +1,10 @@
prefix=/usr/local
PREFIX ?= /usr/local
TASK_DONE = echo -e "\n✓ $@ done\n"
# files that need mode 755
EXEC_FILES=git-quick-stats
.PHONY: test
all:
@echo "usage: make install"
@echo " make reinstall"
@@ -11,21 +13,27 @@ all:
help:
$(MAKE) all
@$(TASK_DONE)
install:
install -m 0755 $(EXEC_FILES) $(prefix)/bin
git config --global alias.quick-stats '! $(prefix)/bin/$(EXEC_FILES)'
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)
uninstall:
test -d $(prefix)/bin && \
cd $(prefix)/bin && \
test -d $(PREFIX)/bin && \
cd $(PREFIX)/bin && \
rm -f $(EXEC_FILES) && \
git config --global --unset alias.quick-stats
@$(TASK_DONE)
reinstall:
git pull origin master
@curl -s https://raw.githubusercontent.com/arzzen/git-quick-stats/master/git-quick-stats > git-quick-stats
$(MAKE) uninstall && \
$(MAKE) install
@$(TASK_DONE)
test:
tests/commands_test.sh
@$(TASK_DONE)

View File

@@ -1,12 +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)
[![homebrew](https://img.shields.io/homebrew/v/git-quick-stats.svg)]()
[![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)
[![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.
> 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
@@ -18,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)
@@ -28,6 +29,8 @@
[**Contribution**](#contribution)
[**FAQ**](#faq)
[**License**](#licensing)
@@ -48,7 +51,7 @@
```bash
git quick-stats
# or
# or
git-quick-stats
```
@@ -56,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
@@ -73,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" )
@@ -119,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)
@@ -132,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:
@@ -159,6 +168,8 @@ This documentation is written using standard [markdown syntax](https://help.gith
#### Tests
[![codecov](https://codecov.io/gh/arzzen/git-quick-stats/branch/master/graph/badge.svg)](https://codecov.io/gh/arzzen/git-quick-stats)
```bash
make test
```
@@ -166,7 +177,7 @@ make test
## Licensing
MIT see [LICENSE][] for the full license text.
[read this page]: http://github.com/arzzen/git-quick-stats/blob/master/CONTRIBUTING.md
[read this page]: http://github.com/arzzen/git-quick-stats/blob/master/docs/CONTRIBUTING.md
[landing page]: http://arzzen.github.io/git-quick-stats
[LICENSE]: https://github.com/arzzen/git-quick-stats/blob/master/LICENSE.txt
[LICENSE]: https://github.com/arzzen/git-quick-stats/blob/master/LICENSE

9
docs/issue_template.md Normal file
View File

@@ -0,0 +1,9 @@
#### Expected behavior and actual behavior.
#### Steps to reproduce the problem.
#### Specifications like the version of the project, operating system, or hardware.

View File

@@ -36,7 +36,7 @@ function 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 (last $_limit)${NORMAL}"
echo -e "${MENU} ${NUMBER} 2)${MENU} Git changelogs (last $_limit days)${NORMAL}"
echo -e "${MENU} ${NUMBER} 3)${MENU} Git changelogs by author ${NORMAL}"
echo -e "${MENU} ${NUMBER} 4)${MENU} My daily status ${NORMAL}"
echo -e "${RED_TEXT} List: ${NORMAL}"
@@ -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
@@ -268,19 +269,20 @@ function branchesByDate() {
function changelogs() {
local author="${1:-}"
local _author=''
local _author
if [ -z "$author" ]; then
option_picked "Git changelogs:"
_author="--author=**"
else
option_picked "Git changelogs for author '$author':"
_author="--author=$author"
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
}