
Git quick statistics - arzzen
https://lukasmestan.com/git-quick-stats/
======
qznc
The more interesting question with git statistics is what they are actually
useful for. Tools like this seem to be guided by which data is available and
easy to extract. What is commits per hour useful for?

Sometimes these metrics are useful. For example, the top committers are
interesting, because it instantly gives you a good hint who is very
experienced with the codebase and its structure.

Two metrics I find useful to know where to refactor: Files with the most
commits and with the most authors.

~~~
paulddraper
Commits per hour is interesting to understand CI/CD requirements.

~~~
sftwds
The commits per hour statistic looks to be how many commits occurred in each
hour of the day: [https://github.com/arzzen/git-quick-stats/blob/master/git-
qu...](https://github.com/arzzen/git-quick-stats/blob/master/git-quick-
stats#L195). For CI/CD requirements you really want to measure the time
difference between every commit and the previous commit. That way you can say
that if your CI/CD processes take less than X amount of time, they will finish
before the next commit Y% of the time.

~~~
paulddraper
Not necessarily.

At any reasonable size, you have to be able to run builds and tests for
features in parallel. And at that point, throughput and scale throughout the
day is rather important.

------
JNRowe
Another alternative that I like is pepper¹. It doesn't have the interactive
menu interface that the OP script has, but it can produce nice results² and
does support other VCSs.

As an added benefit you can just use pepper to generate the data and shift to
_your_ favourite tool for display.

1\. [https://jgehring.github.io/pepper/](https://jgehring.github.io/pepper/)
2\.
[https://jgehring.github.io/pepper/gallery/](https://jgehring.github.io/pepper/gallery/)

------
telotortium
> 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
> himself :).

Or Junio Hamano, for that matter (although there is a greater chance :)

------
stblack
In the same vein, git-extras ([https://github.com/tj/git-
extras/blob/master/Commands.md](https://github.com/tj/git-
extras/blob/master/Commands.md)) has many similar metrics within a wider git
enhancement suite.

------
miguelmota
Bonus points for not being a bloated Node.js NPM module; it's all one bash
script

------
hwj
For people wondering what that's written in: bash (394 LoC according to
tokei).

------
Waterluvian
So I installed and use `git open`. How do these applications get to work,
prefaced by `git`? Wouldn't `git quick-stats` just invoke `git` with an
invalid parameter?

~~~
smarinov
When you installed it, `make` changed your global .gitconfig file and added
the respective Git aliases to it, so that Git would know what to do and not
complain about invalid commands.

This happens on this line of the project's Makefile:
[https://github.com/arzzen/git-quick-
stats/blob/master/Makefi...](https://github.com/arzzen/git-quick-
stats/blob/master/Makefile#L21)

~~~
Waterluvian
Aha. So this is possible because git is designed for these kinds of aliases. I
wasn't sure if maybe it was core to Linux or something. Thank you.

