@@ -8,7 +8,7 @@ import cp from 'node:child_process';
8
8
import fs from 'node:fs' ;
9
9
import readline from 'node:readline' ;
10
10
11
- const SINCE = process . argv [ 2 ] || '6 months ago' ;
11
+ const SINCE = + process . argv [ 2 ] || 5000 ;
12
12
13
13
async function runGitCommand ( cmd , mapFn ) {
14
14
const childProcess = cp . spawn ( '/bin/sh' , [ '-c' , cmd ] , {
@@ -36,19 +36,19 @@ async function runGitCommand(cmd, mapFn) {
36
36
37
37
// Get all commit authors during the time period.
38
38
const authors = await runGitCommand (
39
- `git shortlog -n -s --since ="${ SINCE } "` ,
39
+ `git shortlog -n -s --max-count ="${ SINCE } " HEAD ` ,
40
40
( line ) => line . trim ( ) . split ( '\t' , 2 ) [ 1 ]
41
41
) ;
42
42
43
43
// Get all commit landers during the time period.
44
44
const landers = await runGitCommand (
45
- `git shortlog -n -s -c --since ="${ SINCE } "` ,
45
+ `git shortlog -n -s -c --max-count ="${ SINCE } " HEAD ` ,
46
46
( line ) => line . trim ( ) . split ( '\t' , 2 ) [ 1 ]
47
47
) ;
48
48
49
49
// Get all approving reviewers of landed commits during the time period.
50
50
const approvingReviewers = await runGitCommand (
51
- `git log --since ="${ SINCE } " | egrep "^ Reviewed-By: "` ,
51
+ `git log --max-count ="${ SINCE } " | egrep "^ Reviewed-By: "` ,
52
52
( line ) => / ^ R e v i e w e d - B y : ( [ ^ < ] + ) / . exec ( line ) [ 1 ] . trim ( )
53
53
) ;
54
54
@@ -78,10 +78,11 @@ async function retrieveCollaboratorsFromReadme() {
78
78
// Get list of current collaborators from README.md.
79
79
const collaborators = await retrieveCollaboratorsFromReadme ( ) ;
80
80
81
- console . log ( `${ authors . size . toLocaleString ( ) } authors have made commits since ${ SINCE } .` ) ;
82
- console . log ( `${ landers . size . toLocaleString ( ) } landers have landed commits since ${ SINCE } .` ) ;
83
- console . log ( `${ approvingReviewers . size . toLocaleString ( ) } reviewers have approved landed commits since ${ SINCE } .` ) ;
84
- console . log ( `${ collaborators . length . toLocaleString ( ) } collaborators currently in the project.` ) ;
81
+ console . log ( `In the last ${ SINCE } commits:\n` ) ;
82
+ console . log ( `* ${ authors . size . toLocaleString ( ) } authors have made commits.` ) ;
83
+ console . log ( `* ${ landers . size . toLocaleString ( ) } landers have landed commits.` ) ;
84
+ console . log ( `* ${ approvingReviewers . size . toLocaleString ( ) } reviewers have approved landed commits.` ) ;
85
+ console . log ( `* ${ collaborators . length . toLocaleString ( ) } collaborators currently in the project.` ) ;
85
86
86
87
const inactive = collaborators . filter ( ( collaborator ) =>
87
88
! authors . has ( collaborator ) &&
@@ -90,6 +91,6 @@ const inactive = collaborators.filter((collaborator) =>
90
91
) ;
91
92
92
93
if ( inactive . length ) {
93
- console . log ( '\nInactive collaborators:' ) ;
94
- console . log ( inactive . join ( '\n' ) ) ;
94
+ console . log ( '\nInactive collaborators:\n ' ) ;
95
+ console . log ( inactive . map ( ( name ) => `* ${ name } ` ) . join ( '\n' ) ) ;
95
96
}
0 commit comments