QBoard » Statistical modeling » Stats - Conceptual » Generating statistics from Git repository

Generating statistics from Git repository

  • I'm looking for some good tools/scripts that allow me to generate a few statistics from a git repository. I've seen this feature on some code hosting sites, and they contained information like...
    1.commits per author
    2.commits per day/week/year/etc.
    3.lines of code over time
    4.graphs
    5.... much more
    Basically I just want to get an idea how much my project grows over time, which developer commits most code, and so on.
      August 5, 2020 11:05 AM IST
    0
  • git-bars can show you "commits per day/week/year/etc".

    You can install it with pip install git-bars (cf. https://github.com/knadh/git-bars)

    The output looks like this:

    $ git-bars -p month
    370 commits over 19 month(s)
    2019-10  7    ▀▀▀▀▀▀
    2019-09  36   ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
    2019-08  7    ▀▀▀▀▀▀
    2019-07  10   ▀▀▀▀▀▀▀▀
    2019-05  4    ▀▀▀
    2019-04  2    ▀
    2019-03  28   ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
    2019-02  32   ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
    2019-01  16   ▀▀▀▀▀▀▀▀▀▀▀▀▀▀
    2018-12  41   ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
    2018-11  52   ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
    2018-10  57   ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
    2018-09  37   ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
    2018-08  17   ▀▀▀▀▀▀▀▀▀▀▀▀▀▀
    2018-07  1    
    2018-04  7    ▀▀▀▀▀▀
    2018-03  12   ▀▀▀▀▀▀▀▀▀▀
    2018-02  2    ▀
    2016-01  2    ▀
    
     
      November 25, 2021 12:02 PM IST
    0
  • Beside GitStats (git history statistics generator) mentioned by xyld, written in Python and requiring Gnuplot for graphs, there is also

      August 5, 2020 12:02 PM IST
    0
  • I'm doing a git repository statistics generator in ruby, it's called git_stats.

    You can find examples generated for some repositories on project page.

    Here is a list of what it can do:

    General statistics
    Total files (text and binary)
    Total lines (added and deleted)
    Total commits
    Authors
    Activity (total and per author)
    Commits by date
    Commits by hour of day
    Commits by day of week
    Commits by hour of week
    Commits by month of year
    Commits by year
    Commits by year and month
    Authors
    Commits by author
    Lines added by author
    Lines deleted by author
    Lines changed by author
    Files and lines
    By date
    By extension
    If you have any idea what to add or improve please let me know, I would appreciate any feedback.
      August 19, 2021 2:05 PM IST
    0
  • I tried http://gitstats.sourceforge.net/, starts are very interesting.

    Once git clone git://repo.or.cz/gitstats.git is done, go to that folder and say gitstats <git repo location> <report output folder> (create a new folder for report as this generates lots of files)

     
    This post was edited by Shivakumar Kota at September 19, 2020 4:31 PM IST
      September 19, 2020 4:30 PM IST
    0
  • This simply works: 
    apt-get install gitstats. Then run it on a git directory like this: gitstats ~/gitdir /tmp/output
      September 19, 2020 4:34 PM IST
    0