arzzen / git-quick-stats Goto Github PK
View Code? Open in Web Editor NEW▁▅▆▃▅ Git quick statistics is a simple and efficient way to access various statistics in git repository.
Home Page: https://git-quick-stats.sh/
License: MIT License
▁▅▆▃▅ Git quick statistics is a simple and efficient way to access various statistics in git repository.
Home Page: https://git-quick-stats.sh/
License: MIT License
A cool feature it would be awesome to see is output the results into files/xml to allow visualization in other tools.
What do you say?
Describe the bug
I execute export _GIT_PATHSPEC=':!docs'
in the terminal and there are no errors, however when I execute git-quick-stats and press for example 1 it shows:
fatal: unrecognized argument: -- :!docs total:
To Reproduce
Steps to reproduce the behavior:
export _GIT_PATHSPEC=':!docs'
in the terminalExpected behavior
It should show the stats without the specified folder
Desktop (please complete the following information):
What's the sudo make install
equivalent on windows?
Hi,
Great tool! Thank you a lot, pretty useful to me right now.
However, I am concerned that the frontend guy gets in his stats all the lines of all the JS/CSS libs he added to the project. I am afraid that it could weigh a lot in the stats...
Is there a way to skip some folders, and/or some files by name?
Would be even more awesome, because even more precise!
What do you think?
Cheers,
Would be nice to have stats, per contributor, for the current day.
Change of text output into table
instead of showing lines changed: 25
it would be nice to show instead lines changed: 25 (2%)
for instance
When you run the number 1 option to get the git stats by user it would be nice if you could have the option to ignore the initial commit in some way. Often in older projects that have been moved from a previous source control system over to git, one user did the initial commit. Is it possible to ignore the first commit when running stats by user? Is it possible already and I just didn't see how to do it?
Add support for another languages.
Translations for German, Spanish, Esperanto etc
(original issue #75)
This is an awesome tool that I'll be using to generate a list of first time contributors to our repos/org to showcase on Twitter/medium.
Id love to make the process even easier by having a command that would give me a list of users who contributed for the first time since a certain date.
I'm not very well versed in bash (at all) so I figured I'd atleast request it as a feature.
Nice work all this is wonderful. <3
Just cant seem to figure it out !!! help needed
Followed the read.md but git quick-stats not working
It would be nice if we could add the ability to not show stats related to merges.
I would like to have stats without considering the moved files.
You can achieve something like that when diffing with git diff -M
-M[<n>], --find-renames[=<n>]
Detect renames. If n is specified, it is a threshold on the similarity index
(i.e. amount of addition/deletions compared to the file’s size). For example,
-M90% means git should consider a delete/add pair to be a rename if more than
90% of the file hasn’t changed.
Can you let me know if it's something I can do with the current state of the tool or if it's something not supported at all?
Hi,
this is a feature wish :) it would be awesome if this could be used in a dir with lot git projects and the stats would show a summary about all git projects.
Best Regards
Sven
All other git
programs: built-in, official extension, all third-party extensions I've looked at, are invoked via git foo-bar
rather than git-foo-bar
. Except for your tool.
Thus, it would be nice if you installed to /usr/lib/git-core
instead of /usr/bin
. If you're concerned about your old users' muscle memory, a symlink from one location to the other might be good.
when I run 'make install' in cygwin I get:
install -m 0755 git-quick-stats /usr/local/bin 0 [main] make 10516 child_info_fork::abort: C:\cygwin32\bin\cygcrypt-0.dll: Loaded to different address: parent(0xE0000) != child(0x67700000) make: fork: Resource temporarily unavailable
When I ran the commands in the install section of the makefile, seperately in shell all worked without errors.
I've tried 'make install' in a cygwin with administrator rights and without, both gave me the same error.
I haven't had this problem at home when I tried this with cygwin... So maybe something cygwin related?? Don't know..
Hi,
I forked your repo a couple days ago. I added a few new features (total number of commits, total number of code lines added/deleted, total number of contributors). These features also use the $_since $_until arguments, so that people can get the total number of commits/lines added/lines deleted/contributors within a certain period of time (for example, annually).
The reason I added those features is to see what is development trend and the community growth (in terms of contributors) for an open source project I have been working on.
The code is available here: https://github.com/spirosmastorakis/git-quick-stats
Let me know if you think these features might be useful.
In my project, certain directories contain generated code and I would like to exclude them from the stats. This can be done by using the exclude pathspec documented here: git/git@ef79b1f
For example, the following command will exclude gen1/gen2/gen3 from the log.
git log -- . ':!gen1' ':!gen2' ':!gen3'
Can you add something like _GIT_EXCLUDE to support this use case?
When generating a list of all branches the program crashes.
List of all the branches, ordered by most recent commits:
fatal: unknown field name: color:blue
Hello. I get some errors after run git-quick-stats in cygwin:
$ git-quick-stats
/usr/local/bin/git-quick-stats: line 2: $'\r': command not found
: invalid option nameick-stats: line 3: set: nounset
: invalid option nameick-stats: line 4: set: errexit
/usr/local/bin/git-quick-stats: line 5: $'\r': command not found
/usr/local/bin/git-quick-stats: line 28: syntax error near unexpected token `$'{\r''
'usr/local/bin/git-quick-stats: line 28: `function show_menu() {
Expected: Show date and time of the most recent commit in the commit history for an author.
Actual: Shows the date and time of the last commit attributable to the author in the commit history.
The above commit log will show Author's last commit was 2018-05-01, instead of 2018-06-01.
I tried to run this on a docker based on debian using jenkins on kubernetes.
I stumbled upon missing package: bsdmainutils
It includes the command: column
Please add it to the installation procedure
How do I make it get data from my git repo? Thanks.
Not sure if this is the intended behaviour.
I was expecting something like a list of commit messages since the last tag or something, making it easier to write changelogs.
If single item is the intended behaviour, I'd like to offer this as a suggestion / enhancement.
Describe the bug
A new feature was implemented to show percentages when displaying detailed stats (menu options 1 and 2, or options -T and -R). However, the calculation during "lines changed" (line number 285) may cause an error within awk stating it cannot divide by zero as there is no check to see if the divisor is larger than zero.
To Reproduce
Steps to reproduce the behavior:
mkdir foo && cd foo
git init
touch bar && git add bar && git commit -m "Initial commit"
git quick-stats -T
git quick-stats -R
(and choose author)git quick-stats
(and choose options 1 or 2)Expected behavior
The output should display the calculations properly without error.
Current behavior
Contribution stats (by author) on the current branch:
Tom Ice <[email protected]>:
files: 1 (100%)
commits: 1 (100%)
awk: cmd. line:26: (FILENAME=- FNR=8) fatal: division by zero attempted
export _GIT_SINCE=<DateInIsoFormat>
works like a charm
However, with git log I can also use
git log --since="1 month ago"
git log --since="2 weeks 3 days ago"
and for stat generation I use it this way for instance
git log --author="Your Name Here" --since="1 month ago" --pretty=tformat: --numstat | awk '{ add += $1; subs += $2; loc += $1 - $2 } END { printf "added lines: %s, removed lines: %s, total lines: %s\n", add, subs, loc }' -
However when I do
export _GIT_SINCE="1 month ago"
git quick-stats
> 2
> dev
I get the following
fatal: bad revision 'month'
Is there a way this could be do-able with quick-stats as well ? Would be nice.
There is none at this moment. All of the git commands have comprehensive documentation in the man form, it would be nice, if this quick-stats would follow this.
When "Git changelogs by author" is selected, it ask for author, after input a name with space, it display below error message:
fatal: ambiguous argument 'Tung': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
The changelogs of the author should be displayed
$ cd /tmp/
$ git clone https://github.com/beenotung/tslib.git
$ cd tslib
$ git-quick-stats
# input 3
# input Beeno Tung
commit: ac730db
tag: 1.0.9
Linux BeenoTung-Archlinux-Home 4.13.12-1-ARCH #1 SMP PREEMPT Wed Nov 8 11:54:06 CET 2017 x86_64 GNU/Linux
It can display user name that is not exactly matched.
Example: for user name foo bar
, we can just input foo
.
However if there are two users foo bar
and foo rab
, the result may be disleading.
Describe the bug
My problem is that due to #24 the weekday output is sorted by sum, where as month and hour as sorted by their respective primary key.
In the case of hour this tends to show a nice bell curve, indicating where your peak work time is.
Where as the weekday, since the sort is by sum, it is always top heavy inverted triangle, and the "top" day may change between runs, causing you to have to inspect each line each time.
This is nice for finding what days get the max work in as its always at the top, but does not an as useful chart.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I would like the output of the weekday stat graph to be sorted by the day of the week, and not sum. With the precedent being the month graph is sorted by month (not sum) and per hour is sorted by hour (not sum)
Screenshots
I made a quick mockup to show what the effect of maintaining the day of week sorting would look like.
and the previously mentioned by-hour bell curve
Desktop (please complete the following information):
Additional context
I could be entirely wrong, just armchair hypothesis:
I've taken a quick look at the code, and while my scripting is rusty and your code is awesome, I think the fix would be to drop the sort-by-sum post-sort
added in #24 and just prefill the count array with 0s as you iterate on the Mon-Tue-etc for loop, so that the order of the days is pre-established and not randomly filled in as they are found in the git log output which I believe to be the original root cause of the "random" order in 24.
Right now there are some statistics on the current or a specific branch, I couldn't find a way to output per user commits for instance of all branches. Would be nice to have.
The output from this repo:
Git commits per author:
75\x09Lukas Mestan 89.3%
2\x09Joopmicroop 2.4%
1\x09Raimon Grau 1.2%
1\x09Nicholas Skinsacos 1.2%
1\x09Melih Değiş 1.2%
1\x09Linell 1.2%
1\x09Dustin Blomquist 1.2%
1\x09Brian Kroth 1.2%
1\x09Andrew Huss 1.2%
I'm using the latest version as of today (2017-10-02). I'm on Fedora 26.
As mentioned in #16,
Apparently git-quick-stats is using my overridden pretty format from my git config. To repro, add this to your gitconfig:
[format]
pretty=format:%C(yellow)%h%Creset -%C(red)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset
It reports no contributors for the contribution stats.
You may need to hard code the format you use, or maybe temporarily unset HOME so it ignores the gitconfig.
Expected: signature-related log text should be ignored by script
Actual: signature-related log text is parsed as if it was actual log text
Enable on ~/.gitconfig
:
[log]
showSignature = true
List contributors sorted by name, on a repository with signed commits:
$ git quick-stats # and then select e.g. 7
There exists some git log
command line switch for overriding of this flag - I don't remember which one, but another git-related project used it to avoid this problem.
For large repos it would be nice to be able to get stats for a particular subdirectory, instead of the repo as a whole.
9) Git commits per author
gives the following output:Git commits per author:
204 Youssef Raafat 49.5%
189 Michael Safwat 45.9%
19 Micheline Medhat 4.6%
While the GitHub repo contains the following stats due to Co-authors.
git shortlog --grep='Co-authored-by: Youssef Raafat' -s -n
the output will be 77 Michael Safwat
.shortlog
to the 204 commits of the previous output gives us something near GitHub stats.So is it possible to add option to count commits by authors & co-authors?
I'm trying to run this on any of my repos and I end up with this:
Contribution stats (by author):
total:
insertions: 202248 (100%)
deletions: 72015 (100%)
files: 10782 (100%)
awk: division by zero
input record number 18202, file
source line number 8
It would be awesome to install over basher 😉
show git stats
just run git-quick-stats
output: unknown terminal "xterm"
Sometimes git repositories are slightly messed up with respect to author names. Git actually already sort-of has a fix for this issue (but as it seems only for git shortlog):
https://git-scm.com/docs/git-shortlog#_mapping_authors
It would be really nice if git-quick-stats would also use this file for "properly" mapping commits to authors.
Below is the output of "git commits by weekday" run on kdev-python.
I would have expected this to either be listed in week order or be sorted by the number of commits; instead the order appears random.
Is this expected?
day sum
Tue 275 |=========
Sat 349 |===========
Thu 346 |===========
Sun 410 |==============
Mon 288 |=========
Fri 361 |============
Wed 308 |==========
It's only available in English.
I would like to exclude package-lock.json
from statistics since it's commitable but auto-generated by npm.
As I understand from the readme _GIT_PATHSPEC
works only with dirs?
Expected
Travis CI should work regardless of what branch the developer worked off of. So if the developer creates his or her own feature-based branch in order to add an enhancement or fix an issue, Travis CI should report a successful build if the software is indeed buildable and passes all tests.
Actual
Instead, it appears that Travis CI bombs out and reports it cannot build because it cannot find the feature branch. An example of the failed output can be seen here: https://travis-ci.org/arzzen/git-quick-stats/builds/530223260?utm_source=github_status&utm_medium=notification
Happens in the latest version and configuration of this code base.
git-quick-stats -m
Actual:
Git commits by month:
month sum
Jan 77 |███████████████████████████████████████████████████
Feb 43 |████████████████████████████
Mar 0 |
Expected:
Git commits by month:
month sum
Jan 77 |█████████████████████████████████████████
Feb 43 |██████████████████████
Mar 0 |
Apr 0 |
May 0 |
Jun 0 |
Jul 1 |
Aug 9 |████
Sep 5 |██
Oct 0 |
Nov 7 |███
Dec 8 |████
Find a repository doesn't have commits in some months in the middle of a year.
Then, execute git-quick-stats -m
.
Version 2.0.3-2.0.4
When I use the "Generate Changelog" option, I get the following output instead of just a changelog:
Generate git changelogs:
usage: git rev-list [OPTION] <commit-id>... [ -- paths... ]
limiting output:
--max-count=<n>
--max-age=<epoch>
--min-age=<epoch>
--sparse
--no-merges
--min-parents=<n>
--no-min-parents
--max-parents=<n>
--no-max-parents
--remove-empty
--all
--branches
--tags
--remotes
--stdin
--quiet
ordering output:
--topo-order
--date-order
--reverse
formatting output:
--parents
--children
--objects | --objects-edge
--unpacked
--header | --pretty
--abbrev=<n> | --no-abbrev
--abbrev-commit
--left-right
--count
special purpose:
--bisect
--bisect-vars
--bisect-all
- update readme
Here's an asciinema of exactly what I did to replicate the above.
Hi,
I made a small docker image for your tool, but if you'd like to integrate the dockerfile directly in your project let me know: I'll made a pull request and redirect my repo to yours.
The repo: https://github.com/frxyt/docker-git-quick-stats
It's easier to integrate your tool in a CI/CD toolchain with docker that's why I made it in the first place.
I experienced what I think are a few bugs / issues with the -j
option:
I was expecting to be able to do git-quick-stats -j path/to/stats.json
but this leads to Invalid arguments
I would expect to be able to both select the type of report and precise that I would like a json output. however this does not seem to be possible. for instance git-quick-stats -a -j
instead, no matter the path, we get Invalid path or permission denied to write to given area.
.
Notes:
sudo
does not helpsystem: ubunto 19.10
git-quick-stat commit: 9e18cf3 (HEAD as of 2020-04-30)
Makefile modifies global git configuration at
Line 21 in c38e4eb
Line 28 in c38e4eb
$PATH
, which is quite expected. You can check https://github.com/tj/git-extras for reference.A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.