Skip to content

Commit 8612dfe

Browse files
Add git-pulse
0 parents  commit 8612dfe

8 files changed

+2718
-0
lines changed

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
!.*

.eslintrc.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
extends: eslint:recommended
2+
env:
3+
browser: true
4+
es2021: true
5+
node: true
6+
parserOptions:
7+
ecmaVersion: latest
8+
sourceType: module
9+
rules:
10+
prefer-const: warn
11+
no-var: warn
12+
object-curly-spacing:
13+
- warn
14+
- always

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
yarn.lock

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 Michael[tm] Smith
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
**How to:** Show a [pulse snapshot](#pulse-snapshots) of the past 6 months of committer activity and issue/PR activity for any git/GitHub repo by doing this: `cd` into your local clone of any repo, and run the following:
2+
3+
```bash
4+
curl -fsSLO https://git-pulse.github.io/tools/git-pulse && bash ./git-pulse 6
5+
```
6+
7+
Example output:
8+
9+
```
10+
Committers
11+
┌────────────────────┬───────┐
12+
│ Monthly │ Cu- │
13+
├─────┬───────┬──────┤ mula- │ Monthly
14+
│ New │ Total │ %New │ tive │ commits Month range
15+
├─────┼───────┼──────┼───────┼───────┬───────────────────────────────────────┐
16+
│ 120 │ 167 │ 71 │ 1366 │ 385 │ Nov 01 – Dec 01 2021 ending 5mo ago │
17+
│ 115 │ 166 │ 69 │ 1481 │ 398 │ Dec 01 – Jan 01 2022 ending 4mo ago │
18+
│ 157 │ 221 │ 71 │ 1638 │ 572 │ Jan 01 – Feb 01 2022 ending 3mo ago │
19+
│ 111 │ 169 │ 65 │ 1749 │ 468 │ Feb 01 – Mar 01 2022 ending 2mo ago │
20+
│ 163 │ 222 │ 73 │ 1912 │ 692 │ Mar 01 – Apr 01 2022 ending 1mo ago │
21+
│ 120 │ 192 │ 62 │ 2032 │ 679 │ Apr 01 – May 01 2022 ending today │
22+
└─────┴───────┴──────┴───────┴───────┴───────────────────────────────────────┘
23+
24+
For the last 6 months:
25+
26+
131 new committers per month on average.
27+
189 total active committers per month on average.
28+
69 percent of committers were new committers.
29+
532 commits per month on average.
30+
31+
Cumulative total committers grew by 666 (from 1366 to 2032) in 5 months.
32+
```
33+
34+
![image](https://user-images.githubusercontent.com/194984/166609194-9380ed86-1282-45da-842a-d8ac4e6d4e96.png)
35+
36+
```
37+
┌────────────────┬─────────────────────┐
38+
│ Issues │ PRs │
39+
├────────────────┼─────────────────────┤
40+
│ Clsd Opnd +- │ Mrgd Clsd Opnd +- │ Month range
41+
├────────────────┼─────────────────────┼───────────────────────────────────────┐
42+
│ 169 215 46 │ 373 42 424 9 │ Nov 01 - Dec 01 2021 ending 5mo ago │
43+
│ 229 244 15 │ 401 36 440 3 │ Dec 01 - Jan 01 2022 ending 4mo ago │
44+
│ 223 227 4 │ 569 90 669 10 │ Jan 01 - Feb 01 2022 ending 3mo ago │
45+
│ 188 195 7 │ 470 49 526 7 │ Feb 01 - Mar 01 2022 ending 2mo ago │
46+
│ 305 336 31 │ 692 55 744 -3 │ Mar 01 - Apr 01 2022 ending 1mo ago │
47+
│ 162 199 37 │ 673 62 755 20 │ Apr 01 - May 01 2022 ending today │
48+
└────────────────┴─────────────────────┴───────────────────────────────────────┘
49+
For the last 6 months:
50+
51+
212 issues closed per month on average.
52+
236 issues opened per month on average.
53+
23 issue increase in open issues per month on average.
54+
55+
529 PRs merged per month on average.
56+
99 percent merged PRs / commits ratio
57+
(average 529 merged PRs vs average 532 commits).
58+
55 PRs closed (unmerged) per month on average.
59+
593 PRs opened per month on average.
60+
7 PR increase in open PRs per month on average.
61+
62+
140 issue increase in open issues overall.
63+
46 PR increase in open PRs overall.
64+
```
65+
66+
![image](https://user-images.githubusercontent.com/194984/166609488-ea747459-6477-4b41-b26f-4859f55c104b.png)
67+
68+
## Pulse snapshots
69+
70+
A **pulse snapshot** is a report that answers questions about a project such as the following:
71+
72+
- **How many contributors are actually active each month?**
73+
- **How many new contributors is the project gaining each month?**
74+
- **How many commits are getting merged each month?**
75+
- **How well is the project managing issues and PRs?**
76+
- **How long does an issue or PR typically stay open before it’s resolved?**
77+
- **How many issues and PRs are there which have stayed open for a long time without being resolved?**
78+
- **At what rate are the lists of open issues and PRs increasing or decreasing?**
79+
80+
The `git-pulse` tool generates snapshots with data and graphs that answer those questions.
81+
82+
### Notes on using the git-pulse tool
83+
84+
- The month ranges shown are for logical months based on the current date (today) rather than calendar months. That is, each “month” range shown ends on the same calendar day as today — rather than being a calendar month starting on the 1st of a given month and ending on the 30th, 31st, 28th, or 29th.
85+
86+
- Unless you have either `GITHUB_TOKEN` or `GH_TOKEN` set in your environment, running this tool will likely cause you to quickly exceed the GitHub API rate limits for requests, and start getting 403 error responses.
87+
88+
- Even with `GITHUB_TOKEN`/`GH_TOKEN` set, the tool takes several minutes to run, due to throttling (delay between API calls) added to avoid hitting GitHub API rate limits for (authenticated) requests.
89+
90+
To adjust the throttling (seconds between API calls), run with `-s` option set to a number of seconds (default is 9):
91+
92+
```
93+
bash ./git-pulse -s10
94+
```
95+
96+
- To generate a snapshot for a date range going back from an earlier day than today, install `faketime` (e.g., with `apt install faketime` or `brew install faketime`) and run `git-pulse` like this:
97+
98+
```
99+
faketime -f "@2021-05-01 23:59:59" bash ./git-pulse
100+
```
101+
102+
**Note:** `faketime` won’t work on macOS or other systems with the BSD `date` command. On such systems, use the `-d` option to specify the GNU `date` command rather than the default `date` command; for example, on a macOS system, install the [Homebrew `coreutils` package](https://formulae.brew.sh/formula/coreutils), and run with the `-d` option set like this:
103+
104+
```
105+
brew install coreutils
106+
faketime -f "@2021-05-01 23:59:59" bash ./git-pulse -d/usr/local/bin/gdate
107+
```
108+
109+
- If a repo/clone has a remote named `upstream` defined, the tool uses that remote; otherwise it uses `origin`.
110+
111+
- Add the directory containing the `git-pulse` script to your `$PATH`, so you can use the `git pulse` to run it:
112+
113+
```bash
114+
mkdir git-pulse && cd git-pulse
115+
git clone https://github.com/git-pulse/tools.git
116+
cd tools
117+
echo export PATH=\"$PATH:$PWD\" >> ~/.bash_profile
118+
```
119+
120+
Now you can run `git pulse` in any repo/clone directory to get a pulse snapshot for that repo.
121+
122+
## Pulse rankings
123+
124+
**How to:** Generate a [pulse rankings](https://git-pulse.github.io/snapshots/) report in a directory containing multiple `*-pulse.json` snapshots:
125+
126+
```bash
127+
node tools/git-pulse-rank.js
128+
```

0 commit comments

Comments
 (0)