Package: gitlogstats
Git Developer Contributions AnalysisThis repository contains a command-line tool,gitlogstats, written inpython, to track developers' contributions to one or more Git repositories within a particular time range. GitHub's Insights tools and charts are not extremely useful, and often omit contributors or give misleading statistics.This script calculates the following, for each developer in each repository:number ofcommitsnumber oflines addednumber oflines deletednumber offiles changedThe results can be formatted ascsv,json, ormarkdown.Installgitlogstatscan be installed with a package manager such aspipe.g.pip install gitlogstats,pip3 install gitlogstats, depending on your environment.UsageThe commandgitlogstats --helpshows the usage instructions:usage: gitlogstats [-h] (-r REPOSITORY | -rf REPOFILE) [-u USER] [-s START] [-e END] [-x EXCLUSIONS] [-f {csv,json,markdown}] [-v] [-c]

optional arguments:
  -h, --help            show this help message and exit
  -r REPOSITORY, --repository REPOSITORY
                        the public URL of the repository whose logs to parse
  -rf REPOFILE, --repofile REPOFILE
                        the path to simple text file with a list of repository URLs to parse
  -u USER, --user USER  The git username to report. Default is all contributing users
  -s START, --start START
                        Start date in mm/dd/yyyy format
  -e END, --end END     End date in mm/dd/yyyy format
  -x EXCLUSIONS, --exclusions EXCLUSIONS
                        A comma-separated string of files to exclude, e.g. --excusions "foo.zip, *.jpg, *.json"
  -f {csv,json,markdown}, --format {csv,json,markdown}
                        The format in which to output the results
  -v, --verbose         Whether to output debugging info
  -c, --clean           Remove contributors without any contribuitionIn casegitlogstatsis not found as a command, even after installing, trypython -m gitlogstatsorpython3 -m gitlogstatsinstead.Example usageSingle versus multiple repository analyticsThe-rand-rfflags control whether the script looks at a single repository, or a batch of repositories stored in a simple text file.Output the contributions of all developers to a single repository:gitlogstats-rhttps://github.com/bloombar/git-developer-contribution-analysis.gitOutput the contributions of all developers to a set of repositories stored in a file namedrepos.txt(seeexample file):gitlogstats-rfrepos.txtIndividual contributor versus all contributorsBy default, the statistics of all contributors are calculated. The-uflag can be used to limit the analysis to just a single contributor by referencing their git username.Output the contributions of only the contributor namedbloombarto a single repository:gitlogstats-ubloombar-rhttps://github.com/bloombar/git-developer-contribution-analysis.gitThe same, but to a batch of repositories listed in therepos.txtfile:gitlogstats -u bloombar -rf repos.txtCustom date rangeBy default, contributions from a year ago until today are analyzed. Use the-sand-eflags to specify a different start and end date, respectively.Output the contributions to a single repository for a specific date range, inclusive.gitlogstats-s11/15/2021-e12/15/2021-rhttps://github.com/bloombar/git-developer-contribution-analysis.gitThe same, but to a batch of repositories listed in therepos.txtfile:gitlogstats -s 11/15/2021 -e 12/15/2021 -rf repos.txtFilter ContributorsResults can be filtered to show only contributors with activity. Use the-cto file the result.gitlogstats -rf repos.txt -cFormatting the resultsThe results can be formatted ascsv,json, or amarkdowntable. The default iscsv. Use the-fflag to control the output format.gitlogstats -s 11/15/2021 -e 12/15/2021 -rf repos.txt -f markdownCombinationsFlags can be combined to provide more targeted analysis, e.g. a specific contributor over a specific date rangegitlogstats -u bloombar -s 11/15/2021 -e 12/15/2021 -r https://github.com/bloombar/git-developer-contribution-analysis.git -f jsonThe same, but to a batch of repositories listed in therepos.txtfile:gitlogstats -u bloombar -s 11/15/2021 -e 12/15/2021 -rf repos.txt -f jsonWords of cautionLarge numbers of additions or deletionsIf a particular contricutor shows a very large number of additions or deletions, typically on the order of many hundreds or thousands, this could be a sign of poor usage of version control.Most likely, the contributor has failed to update their version control settings to ignore platform or 3rd party code to (i.e. has not updated their.gitignorefile prior to adding such code), and is therefore tracking additions/deletions of code that is not theirs. The entire contribution for that user during this date range should be ignored in this case until the developer fixes this problem.Redundant usernamesThe output of the script sometimes lists the same individual contributor under more than one git username... This is most likely due to different username settings for various git and GitHub clients.If a single developer has multiple usernames that all show the same statistics, then only count those stats once. Otherwise, if a single developer has multiple usernames that show different statistics, then add them together to come up with the total for that developer.