Pārlūkot izejas kodu

Add SLOC analysis and composition table (analyzesloc + SLOC helpers) — gitstats

Track and plot pace of changes (pace_of_changes data + pace_of_changes.png/.dat) — gitstats
Add PDF report generator using fpdf2 with embedded charts (PDFReportCreator) — gitstats
Add repository size calculation and getter (repository_size_mb + getRepositorySize) — gitstats
Add last-30-days and last-12-months activity summaries and accessors (last_30_days_*, last_12_months_*) — gitstats
Add SLOC-per-extension breakdown on lines page and related data writers — gitstats
Add commit timing / external-command timing and --debug/--verbose tracing in runner — gitstats
Chores

Update README with usage, options, dependencies, outputs, and troubleshooting — README.md
Replace counting patterns with defaultdict(int) for robustness (DataCollector fields) — gitstats
Fix multirepo tags isolation (ensure tags cleared/isolated per repo) — gitstats
Initialize author entries consistently to avoid KeyError (author info structure) — gitstats
Generate and keep consistent .dat/.plot gnuplot artifacts and improve createGraphs hygiene — gitstats
lechibang-1512 2 mēnešus atpakaļ
vecāks
revīzija
ee7cafdd93
3 mainītis faili ar 690 papildinājumiem un 116 dzēšanām
  1. 0
    34
      Makefile
  2. 47
    6
      README.md
  3. 643
    76
      gitstats

+ 0
- 34
Makefile Parādīt failu

@@ -1,34 +0,0 @@
1
-PREFIX=/usr/local
2
-BINDIR=$(PREFIX)/bin
3
-RESOURCEDIR=$(PREFIX)/share/gitstats
4
-RESOURCES=gitstats.css sortable.js *.gif
5
-BINARIES=gitstats
6
-VERSION=$(shell git describe 2>/dev/null || git rev-parse --short HEAD 2>/dev/null || date +%Y-%m-%d)
7
-SEDVERSION=perl -pi -e 's/VERSION = 0/VERSION = "$(VERSION)"/' --
8
-
9
-all: help
10
-
11
-help:
12
-	@echo "Usage:"
13
-	@echo
14
-	@echo "make install                   # install to ${PREFIX}"
15
-	@echo "make install PREFIX=~          # install to ~"
16
-	@echo "make release [VERSION=foo]     # make a release tarball"
17
-	@echo
18
-
19
-install:
20
-	install -d $(BINDIR) $(RESOURCEDIR)
21
-	install -v $(BINARIES) $(BINDIR)
22
-	install -v -m 644 $(RESOURCES) $(RESOURCEDIR)
23
-	$(SEDVERSION) $(BINDIR)/gitstats
24
-
25
-release:
26
-	@cp gitstats gitstats.tmp
27
-	@$(SEDVERSION) gitstats.tmp
28
-	@tar --owner=0 --group=0 --transform 's!^!gitstats/!' --transform 's!gitstats.tmp!gitstats!' -zcf gitstats-$(VERSION).tar.gz gitstats.tmp $(RESOURCES) doc/ Makefile
29
-	@$(RM) gitstats.tmp
30
-
31
-man:
32
-	pod2man --center "User Commands" -r $(VERSION) doc/gitstats.pod > doc/gitstats.1
33
-
34
-.PHONY: all help install release

+ 47
- 6
README.md Parādīt failu

@@ -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.

+ 643
- 76
gitstats
Failā izmaiņas netiks attēlotas, jo tās ir par lielu
Parādīt failu