3 releases
Uses new Rust 2024
| 0.1.2 | Mar 5, 2026 |
|---|---|
| 0.1.1 | Mar 4, 2026 |
| 0.1.0 | Mar 4, 2026 |
#72 in Visualization
36KB
535 lines
Locoti
Locoti is a fork of Locot. A simple utility for tracking lines of code over time in a Git repository. Outputs CSV for visualization and analysis.
Improvements over Locot
- Reads commit trees directly from the local Git object database instead of cloning and checking out every revision.
- Caches subtree stats by Git tree ID, so identical trees across history are counted once
- Caches blob-level parsing and ignore decisions to reduce repeated work during history scans
- Uses faster hash maps (
rustc_hash::FxHashMap) in the hot path - Improves ignore filtering by respecting
.gitignoreand.ignorerules - Improves language detection for extensionless files via shebang detection
Performance
$ hyperfine 'locoti ./tokei' 'locot --path ./tokei'
Benchmark 1: locoti ./tokei
Time (mean ± σ): 249.2 ms ± 8.6 ms
Benchmark 2: locot --path ./tokei
Time (mean ± σ): 5.996 s ± 0.088 s
Summary
locoti ./tokei ran 24.06 times faster than locot --path ./tokei
Install
From crates.io:
cargo install locoti
From this repository:
cargo install --path .
Usage
Analyze the current repository and save the results:
locoti > results.csv
Analyze a specific repository path:
locoti /path/to/repo > results.csv
CLI options
| Option | Description |
|---|---|
<PATH> |
Path to the repository to analyze (default: .) |
-f, --format <FORMAT> |
Output format (currently csv) |
-h, --help |
Print help |
-V, --version |
Print version |
Output format
The CSV contains:
Commit: commit hashTime: commit timestamp (UTC, RFC 3339 format)Total: total lines counted at that commit- Language columns: one column per language with non-zero lines in at least one commit
Example output
| Commit | Time | Total | Markdown | Rust | TOML |
|---|---|---|---|---|---|
| b9d3f2b3ecc975870cdf9efc714ed441c81caed2 | 2023-05-11T14:11:12Z | 2 | 2 | 0 | 0 |
| 88ab06991a322fe6a731700c255b1a0b0ba5bddb | 2023-05-11T14:15:32Z | 7 | 7 | 0 | 0 |
| fa8e52ae130e1e47e5ec71ff84ec9b3f7d3aa48f | 2023-05-17T12:58:42Z | 76 | 2 | 63 | 11 |
| eb430bb6e3006974e42b67e8603fce10a6c10812 | 2023-05-17T13:02:03Z | 86 | 2 | 73 | 11 |
| 46c56a4a92310242ad17d245db4932f00f726e4a | 2023-05-17T13:03:08Z | 83 | 2 | 70 | 11 |
License
GNU GPL v3
Dependencies
~24–43MB
~738K SLoC