|
|
@@ -44,15 +44,56 @@ Example:
|
|
44
|
44
|
|
|
45
|
45
|
```sh
|
|
46
|
46
|
python gitstats /path/to/your/repo /path/to/output
|
|
|
47
|
+To generate statistics for a git repository:
|
|
|
48
|
+
|
|
|
49
|
+```sh
|
|
|
50
|
+python gitstats <path-to-git-repo> <output-directory>
|
|
|
51
|
+```
|
|
|
52
|
+
|
|
|
53
|
+Common options:
|
|
|
54
|
+
|
|
|
55
|
+- `--debug`: print detailed command traces and timings (useful for diagnosing issues).
|
|
|
56
|
+- `--verbose`: show progress and executed git/gnuplot commands.
|
|
|
57
|
+- `--processes N`: run N worker processes when collecting data (default depends on your machine).
|
|
|
58
|
+
|
|
|
59
|
+Example:
|
|
|
60
|
+
|
|
|
61
|
+```sh
|
|
|
62
|
+python gitstats /path/to/your/repo /path/to/output --verbose --processes 4
|
|
47
|
63
|
```
|
|
48
|
64
|
|
|
49
|
|
-This will analyze the git repository and generate an HTML report in the output directory.
|
|
|
65
|
+This will analyze the git repository and generate an HTML report (and optional PDF) in the output directory.
|
|
|
66
|
+
|
|
|
67
|
+Required system dependencies and notes:
|
|
|
68
|
+
|
|
|
69
|
+- **Python 3.x**: the script targets modern Python 3.
|
|
|
70
|
+- **Git**: required for reading repository history.
|
|
|
71
|
+- **gnuplot**: used to render charts. If not installed, `.dat` and `.plot` files will still be produced but PNG graphs won't be generated.
|
|
|
72
|
+- **fpdf** (Python package): used to create a summary PDF. You may see deprecation warnings from older fpdf APIs; the PDF is still created successfully, but updating `fpdf` usage can remove warnings.
|
|
|
73
|
+
|
|
|
74
|
+Install Python dependencies (if provided):
|
|
|
75
|
+
|
|
|
76
|
+```sh
|
|
|
77
|
+pip install -r requirements.txt
|
|
|
78
|
+```
|
|
|
79
|
+
|
|
|
80
|
+On Debian/Ubuntu you can install system deps with:
|
|
|
81
|
+
|
|
|
82
|
+```sh
|
|
|
83
|
+sudo apt-get update && sudo apt-get install git gnuplot
|
|
|
84
|
+```
|
|
50
|
85
|
|
|
51
|
|
-## License
|
|
|
86
|
+Generated output (example files written to the output directory):
|
|
52
|
87
|
|
|
53
|
|
-This project is a fork of [hoxu/gitstats](https://github.com/hoxu/gitstats). Please refer to the original project for licensing details.
|
|
|
88
|
+- `index.html`: main HTML report with links to charts and pages.
|
|
|
89
|
+- `authors.html`, `lines.html`, `files.html`, `tags.html`, `activity.html`: detail pages for each statistic.
|
|
|
90
|
+- `*.dat`, `*.plot`: raw data and gnuplot scripts used to generate images.
|
|
|
91
|
+- `*.png`: chart images produced by `gnuplot` (if available).
|
|
|
92
|
+- `gitstats_*.pdf`: optional PDF summary produced via `fpdf`.
|
|
54
|
93
|
|
|
55
|
|
-## Acknowledgements
|
|
|
94
|
+Troubleshooting tips:
|
|
56
|
95
|
|
|
57
|
|
-- Original author: [hoxu/gitstats](https://github.com/hoxu/gitstats)
|
|
58
|
|
-- Ported to Python 3 by [lechibang-1512](https://github.com/lechibang-1512)
|
|
|
96
|
+- If charts are missing, confirm `gnuplot` is installed and available in your `PATH`.
|
|
|
97
|
+- If the script fails with permission errors, ensure you have read access to the git repository and write access to the output directory.
|
|
|
98
|
+- Use `--debug` to see the exact git and gnuplot commands being executed; this helps reproduce and fix issues.
|
|
|
99
|
+- If you see fpdf deprecation warnings, the PDF is likely still generated. Consider upgrading the `fpdf` package or updating the PDF-generation code to use the current API.
|