Returns a text file containing the top commit authors for a repo during a particular period and their individual total commits
This script requires the following to function:
.[NODEJS] V14.15.1
.[GIT] V2.29.2
.[ShellJS] V0.8.5
Install NODE globally as normal. Visit https://nodejs.org/en/
Install GIT globally as normal. Visit https://git-scm.com/
Install Node Modules. Run
npm i
within the sort authors folder
Upon starting the script, it will promot the user to enter the required valued in the following formats. The repo path has to be up the root directory.
- Full repository path (locally) = FORMAT - "C:\Users\shaqu\Desktop\Sort Authors"
- Starting date for period of data retrieval = FORMAT - Dec 9 2021
- Ending date for the period of data retrieval = FORMAT - July 9 2022
- Desired number of Authors to return = FORMAT - 12
Within terminal. Run
node sortAuthors.js
The CLI terminal will start up welcoming the user, then proceeding to get the required info. When all necessary information is entered a completion message will be logged and a text file titled "authors" will be created within the root directory of the working folder. This contains the top authors for the given period. With the total number of commits listed on the left as well as their names and email addresses.
EXAMPLE:
89 Rodolfo Alonso Hernandez <[email protected]>
52 Slawek Kaplonski <[email protected]>
33 yatinkarel <[email protected]>
13 Jakub Libosvar <[email protected]>
12 LIU Yulong <[email protected]>
12 elajkat <[email protected]>
9 Oleg Bondarev <[email protected]>
8 zhouhenglc <[email protected]>
5 Arnau Verdaguer <[email protected]>
5 Frode Nordahl <[email protected]>
When running the script multiple times be sure to clear the authors.txt file or delete it entirely because the information will be appended to the existing data and this can be confusing.
The number of authors will have to be adjusted according to the number of authors within the repository for the given period. If the number is adjusted more than the total amount of commit authors avaliable, the script will return undefined for the additional entries.