gitinspector: per-author git statistics for grading and audits
:bar_chart: The statistical analysis tool for git repositories
At a glance
- What is it?
- gitinspector is a GPL-3.0 Python tool that reads a git repository and reports cumulative work per author, with an optional timeline. It is built for instructors grading student projects, and it ships as a CLI, an npm package and a Docker image.
- Who is it for?
- Adopt gitinspector if you need per-author line statistics from a git history and want the result as HTML, JSON, XML or plain text on a machine that already has git and Python. Do not adopt it if you need per-file blame attribution, a graphical interface or a Windows or macOS desktop app; the README points those users at the rewritten GitInspectorGUI instead.
- Can I use it commercially?
- Yes, with conditions. GPL-3.0 is a copyleft licence: if you distribute software that includes it, you must release that software's source code under the same licence. Running it internally without distributing it does not trigger that obligation.
- Is it still maintained?
- Yes. The repository last received commits 31 days ago.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 24, 2026, and from our analysis. They are not legal advice.
Star history
- ejwa/gitinspector2,513 ★ · +1
| Repository | 2026-09-30 | 2026-11-24 |
|---|---|---|
| ejwa/gitinspector | 2.5k | 2.5k |
1 Stars in the last 55 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
What gitinspector measures that git log does not
A git log tells you what changed and when. It does not tell you how the work is distributed across the people who made the commits, and that distribution is exactly what an instructor grading a team project needs. gitinspector reads a repository and produces a per-author breakdown of cumulative work, and it can add a timeline analysis that shows workload and activity for each author over time. The README states the tool was originally written to fetch repository statistics from student projects in the course Object-oriented Programming Project (TDA367/DIT211) at Chalmers University of Technology and Gothenburg University, and that it is used as a grading aid by universities worldwide. That origin explains the defaults: the analysis is filtered by file extension, and by default only source files are counted, so a repository full of generated assets or vendored dependencies does not drown out the code a student actually wrote. The audience is narrow on purpose. If you want to know who wrote which line in one specific file, this is not the tool. If you want a defensible number for how much of a codebase each contributor produced, it is.
How the analysis runs: git subprocesses, extension filters, four output formats
The mechanism is not a library that parses packfiles. gitinspector drives git itself, and the README states it is multi-threaded and uses multiple instances of git to speed up analysis when possible. That design choice has consequences worth naming. It means the tool inherits whatever git already knows about the repository, including the history as committed, and it means performance scales with how fast git can walk the log rather than with any indexing the tool maintains. There is no database and no cache to invalidate. The extension filter is the second half of the mechanism. The default set is java,c,cc,cpp,h,hh,hpp,php,py,glsl,rb,js,sql,go,swift,ts,tsx,rs,groovy, and the tool can also scan for all filetypes by extension found in the repository. Results come out as HTML, JSON, XML or plain text on the console. The HTML report is described as responsive, with light and dark modes, sortable tables and a search box that work on phones. There is also a code-metrics mode that reports violations of different code metrics, which is a different question from authorship and worth treating as a separate feature rather than part of the default output.
Installing gitinspector and running a first report
The README lists three routes. There are official Debian packages maintained by Christian Kastner, installable with apt-get on Debian-based distributions, and the release artifacts include unofficial packages generated with stdeb. There is an npm package, provided for convenience, installed globally. The repository also contains a Dockerfile for anyone who would rather not install gitinspector at all, and the README gives the build and run commands directly.
The npm route is the shortest if you already have Node:
npm i -g gitinspectorAfter that, the binary named in package.json is gitinspector, which points at gitinspector.py. Run it from inside a repository and you get the default per-author statistics filtered to the default extension list. To narrow the analysis to Python files and add the timeline, the Dockerfile comments show the flag combination the maintainers use:
gitinspector -f py -TThe -f flag sets the extension filter and -T turns on the timeline analysis. If you want the HTML report instead of console text, the Dockerfile comment shows how the output is redirected:
gitinspector -F html > report.htmlThe Docker path avoids installing anything on the host. Build from the root of the sources, then mount the repository you want to analyze on /repo:
docker build -t gitinspector .
docker run --rm -v "$PWD:/repo" gitinspector -f py -TThe Dockerfile sets the working directory to /repo and marks that mount point as a safe directory for git, because the mounted repository belongs to the host user rather than root and git refuses to read from it otherwise. Only the mount point is trusted; the rest of the image keeps the ownership check. The README's example outputs for Django, JQuery, Pango and gitinspector itself were generated with the -HTlrm flags, which is a useful starting point if you want to compare your report shape against a known one.
Where gitinspector gives you the wrong answer
Line counts are not effort, and gitinspector counts lines. A contributor who reformats a file, regenerates a lockfile or lands a large vendored dependency can outrank a contributor who spent the same week on a hard bug with a small diff. The extension filter mitigates this but does not remove it, and the default filter is a real trap: if your project is written in a language outside the default list, the default run will report statistics that omit it. That is not a bug, but it is the most likely way to get a misleading report. The tool also reflects the commit history as git records it, so a repository where one person commits on behalf of several contributors, or where work was squashed before merge, will attribute that work to whoever ran the commit. There is no blame analysis in gitinspector itself; the README notes that blame information per file appears in the rewritten fork, not here. The project also classifies itself as Development Status :: 4 - Beta in setup.py, so treat the output as an input to a judgement rather than the judgement itself. Finally, the README documents no rollback or undo behaviour because there is nothing to roll back: the tool reads a repository and writes a report, and it does not modify the repository it analyzes.
GitInspectorGUI, GitStats and RepoSense as different answers
The README itself points to the closest alternative. GitInspectorGUI started out as an extension of gitinspector and has since been rewritten from scratch. It offers a graphical interface next to the command line, HTML and Excel output with blame information per file, and stand-alone apps for Windows and macOS. The difference in approach is not cosmetic: blame attribution per file answers a question gitinspector deliberately does not, and stand-alone apps remove the Python and git prerequisites that the Dockerfile and the npm package exist to work around. If your reason for looking at gitinspector is that you want a desktop tool on Windows, the README is telling you to look there instead. Other names that come up in the same searches, such as GitStats, Git-fame and RepoSense, are separate projects; the README does not describe their internals, so the honest comparison is limited to the one the README makes. On packaging, gitinspector's own distribution story is broader than most: Debian packages, an npm package, and a Dockerfile in the repository root.
Maintenance, licence and what an upgrade costs you
The repository is not archived, and the last push was on 2026-09-25. The release history shows the shape of the project's activity clearly: v0.4.4 landed on 2016-02-03, and then v0.5.0 on 2026-09-09 and v0.5.1 on 2026-09-25. A decade-long gap between releases followed by two releases in the same month is the fact to plan around. It means the current line is young, and it means documentation written against 0.4.x may not describe the 0.5.x output, particularly the responsive HTML report with light and dark modes, sortable tables and the search box. Upgrading from 0.4.4 is therefore not a routine patch bump; check the CHANGES.txt in the repository root before you move. On licensing, gitinspector is GPL-3.0, and setup.py declares GPLv3 or later. If you embed it in a larger product or redistribute a modified version, the GPL's copyleft terms apply to that distribution. The gitinspector logo is a separate matter: the README states it is partly based on the git logo, based on the work of Jason Long, and licensed under Creative Commons Attribution 3.0 Unported. The README also notes the Debian packages shipped with releases are unofficial and generated with stdeb, while Christian Kastner maintains the official Debian packages tracked on the Debian Package Tracker. This is a description of the licensing and packaging facts, not legal advice.
Editorial conclusion
Adopt gitinspector if you need per-author line statistics from a git history and want the result as HTML, JSON, XML or plain text on a machine that already has git and Python. Do not adopt it if you need per-file blame attribution, a graphical interface or a Windows or macOS desktop app; the README points those users at the rewritten GitInspectorGUI instead. Before you rely on a report, verify that the default extension filter matches the languages in your repository, since the default list is java,c,cc,cpp,h,hh,hpp,php,py,glsl,rb,js,sql,go,swift,ts,tsx,rs,groovy and anything outside it is excluded unless you pass -f.
Frequently asked questions
How do I install gitinspector?
The README lists three routes: official Debian packages installable with apt-get on Debian-based distributions, a global npm package installed with npm i -g gitinspector, and a Dockerfile in the repository root that you build with docker build -t gitinspector . and run against a repository mounted on /repo. The npm package is described as provided for convenience.
Does gitinspector have a GUI?
gitinspector itself is a command line tool with HTML, JSON, XML and plain text output. The README points to GitInspectorGUI, which started as an extension of gitinspector, was rewritten from scratch, and offers a graphical interface alongside stand-alone apps for Windows and macOS.
Which file extensions does gitinspector analyze by default?
The default filter is java,c,cc,cpp,h,hh,hpp,php,py,glsl,rb,js,sql,go,swift,ts,tsx,rs,groovy, and by default only source files are included in the statistical analysis. You can change the filter with the -f flag, and the tool can also scan for all filetypes by extension found in the repository.
Can gitinspector run without installing Python or git on my machine?
Yes, through the Dockerfile included in the repository. The README gives the build and run commands, and the Dockerfile notes that the mounted repository is marked as a safe directory because it belongs to the host user rather than root.
Does gitinspector show blame information per file?
The README does not describe blame analysis in gitinspector. It states that blame information per file is a feature of GitInspectorGUI, the fork that was rewritten from scratch.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/ejwa-gitinspector)Star history chart for your README
[](https://hysenlabs.com/projects/ejwa-gitinspector)Was this useful?