https://github.com/pybites-open-source/git-stats
https://github.com/pybites-open-source/git-stats
hacktoberfest
Last synced: 7 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/pybites-open-source/git-stats
- Owner: PyBites-Open-Source
- License: mit
- Created: 2021-06-05T10:17:34.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-10-26T10:28:05.000Z (over 3 years ago)
- Last Synced: 2025-04-07T08:36:05.708Z (11 months ago)
- Topics: hacktoberfest
- Language: Python
- Homepage:
- Size: 67.4 KB
- Stars: 16
- Watchers: 1
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Are you an active developer?
The aim of this package is to get some useful stats from a local `git` repo.
## To run it
All code uses Standard Library so far so you should be able to run it upon checkout:
```
python3 -m stats YOUR_REPO_FOLDER
```
## Example output
Bit meta but here is how it looks for this repo at this time of writing:
```
$ python3 -m stats ~/code/git-stats
--------------------------------------------------
< Git Repo Activity Report >
> Repo: git-stats
--------------------------------------------------
* Repo changes (inserts and deletes) per week:
2021-22 | 1607
2021-23 | 479
* Number of commits per week and author:
2021-22
- Bob Belderbos | 32
2021-23
- Bob Belderbos | 3
* Files that are most often found in commits:
stats/git.py | 16
stats/report.py | 9
tests/functional/test_report.py | 6
README.md | 5
tests/conftest.py | 4
stats/stats.py | 3
Makefile | 3
stats/__main__.py | 3
tests/unit/test_git.py | 2
tests/test_git.py | 2
--------------------------------------------------
```
To run it from any repo / directory, add this to your `.bashrc` (`.zshrc`) file (assuming your virtual environment is called `venv` and is located in the project folder):
```
alias ae='source venv/bin/activate'
function gitst {
(pwd=`pwd` && cd ~/code/git-stats/ && ae && python3 -m stats $pwd)
}
```
The sub shell (`()`) makes that it should not have any side effects on your current shell session.
## To run the tests:
There are unit tests and one functional (end-to-end) test. You can run them like this:
```
make venv
source venv/bin/activate
make install
make unit (or make test)
make functional
make testall
make coverage
```