git-repo-language-trends

Crates.iogit-repo-language-trends
lib.rsgit-repo-language-trends
version0.4.0
sourcesrc
created_at2021-01-23 20:08:21.450073
updated_at2021-02-01 19:38:02.472429
descriptionPrints tabulated data about programming language usage over time in a git repository.
homepagehttps://github.com/Enselic/git-repo-language-trends
repositoryhttps://github.com/Enselic/git-repo-language-trends
max_upload_size
id345781
size49,868
Martin Nordholts (Enselic)

documentation

https://github.com/Enselic/git-repo-language-trends/blob/main/README.md

README

git-repo-language-trends

Prints tabulated data about programming language usage over time in a git repository.

Copy-paste the output into your favourite spreadsheet software to easily make a graph. Stacked area chart is recommended.

Example

Simply pass the file extensions of the languages you want the trend for.

% cd ~/src/your-project
% git-repo-language-trends .cpp .rs
                .cpp    .rs
2021-01-23      0       121
2021-01-22      120     107
2021-01-19      243     66

Then copy-paste the output into your favourite spreadsheet software and make a graph.

Installation

Pre-built binaries

You can download pre-built binaries for Linux, Mac and Windows for the latest release here.

cargo install

If you have Rust and Cargo installed, all you need to do to fetch, build and install the self-contained git-repo-language-trends crate is:

cargo install git-repo-language-trends

From source

You can of course also clone this repo and then simply cargo build it if you have Rust and Cargo installed on your system.

Performance

This program is fast. It counts ~5 000 000 lines / second on a high-end 2018 laptop on a large repository (with --disable-progress-bar). (For smaller repositories, the number is lower.)

This is because the inner loop uses the Rust libgit2 bindings. A regular shell script on a fast 2018 laptop that uses git show $COMMIT:$FILE in the inner loop counts only ~20 000 lines / second.

Commit count: 134

cargo fmt