News for hackers. Stuff that matters.
Re:Git quick statistics by qznc on Monday December 17, 2018 @02:03PM (#18701201)
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.

Re:Git quick statistics by rgrau on Monday December 17, 2018 @04:48PM (#18702543)
In a new job/project, knowing the span of dates per author gives me an idea of the churn of the company, and how long are people staying there.

I had a script to do it and when I discovered this project I contributed this feature

Re:Git quick statistics by jlg23 on Monday December 17, 2018 @02:48PM (#18701555)
You are right, IMHO, but you are also wrong: "commits by hour" and "top committers" are the same metric simply applied to time frames.
Re:Git quick statistics by paulddraper on Monday December 17, 2018 @02:44PM (#18701527)
Commits per hour is interesting to understand CI/CD requirements.
Re:Git quick statistics by sftwds on Monday December 17, 2018 @03:00PM (#18701655)
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.... 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.
Re:Git quick statistics by paulddraper on Monday December 17, 2018 @03:50PM (#18702085)
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.

Re:Git quick statistics by JNRowe on Monday December 17, 2018 @12:16PM (#18700312)
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/ 2. https://jgehring.github.io/pepper/gallery/

Re:Git quick statistics by telotortium on Monday December 17, 2018 @12:34PM (#18700466)
> 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 :)

Re:Git quick statistics by stblack on Monday December 17, 2018 @04:24PM (#18702349)
In the same vein, git-extras (https://github.com/tj/git-extras/blob/master/Commands.md) has many similar metrics within a wider git enhancement suite.
Re:Git quick statistics by miguelmota on Monday December 17, 2018 @01:56PM (#18701128)
Bonus points for not being a bloated Node.js NPM module; it's all one bash script
Re:Git quick statistics by hwj on Monday December 17, 2018 @11:01AM (#18699737)
For people wondering what that's written in: bash (394 LoC according to tokei).
Re:Git quick statistics by Waterluvian on Monday December 17, 2018 @05:14PM (#18702738)
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?
Re:Git quick statistics by smarinov on Monday December 17, 2018 @05:21PM (#18702794)
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...

Re:Git quick statistics by Waterluvian on Monday December 17, 2018 @05:28PM (#18702842)
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.
Re:Git quick statistics by erik_seaberg on Monday December 17, 2018 @05:19PM (#18702777)

  $ cat >~/bin/git-foo
  echo foo!
  $ chmod +x ~/bin/git-foo
  $ git foo
  foo!
  $ git help foo
  No manual entry for git-foo
Re:Git quick statistics by zimpenfish on Tuesday December 18, 2018 @04:35AM (#18705463)
Aside from aliases in your `.gitconfig`, as far as I know, if `git-subcommand` exists in your path, `git subcommand` will call that script for you automatically.

ie if you put `git-monkey` in `$HOME/bin`, add `$HOME/bin` to your path, now `git monkey` is a valid subcommand.