Metadata-Version: 2.4
Name: git-lines-graph
Version: 2.2.0
Summary: Git commit lines graph
Project-URL: Repository, https://github.com/danielfleischer/git-commits-lines-graph
Project-URL: Issues, https://github.com/danielfleischer/git-commits-lines-graph/issues
Project-URL: Homepage, https://github.com/danielfleischer/git-commits-lines-graph
Author: Daniel Fleischer
License-Expression: GPL-3.0-or-later
License-File: LICENSE
Keywords: commits,development,git,graph,visualization
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Scientific/Engineering :: Visualization
Classifier: Topic :: Software Development :: Version Control :: Git
Requires-Python: >=3.9
Requires-Dist: gitpython>=3.1.43
Requires-Dist: matplotlib>=3.9.2
Requires-Dist: pandas>=2.2.2
Description-Content-Type: text/markdown

# Git Commit Lines Graph

[![PyPI](https://img.shields.io/pypi/v/git-lines-graph?color=brightgreen)](https://pypi.org/project/git-lines-graph/)
[![Python Version](https://img.shields.io/pypi/pyversions/git-lines-graph?color=orange)](https://pypi.org/project/git-lines-graph/)
[![License: GPL v3+](https://img.shields.io/badge/License-GPLv3+-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
[![Downloads](https://img.shields.io/pypi/dm/git-lines-graph?color=red)](https://pypi.org/project/git-lines-graph/)

A small python script to visualize the number of lines in a project, as a function of time.

<img src="https://raw.githubusercontent.com/danielfleischer/git-commits-lines-graph/master/example.png" width="400" align="center">

## Install

```sh
uv tool install git-lines-graph   
# OR
python3 -m pip install git-lines-graph
```

## Usage

Run: `git-lines-graph [-b BRANCH] [GIT-DIR]`

Call with an optional git project directory. You can also specify a branch to scan; other wise the branch currently checked in is used.

## Dependencies

- `GitPython` to interact with `git`.
- `matplotlib` for plotting.
- `pandas` for data manipulation.

----

### How Does It Work

The code goes over all commits messages and looks for the number of lines added/removed and keeps an updated count. **Caveat**: the lines reported in git commit messages are only a proxy for the true number of lines of code. It could be way off in projects in which there are data artifacts such as big data files. One solution is to loop over all commits, checkout the commit and do a `wc` over all files that are considered to be code files. But that's slower and could be dangerous in dirty projects.
