This repository contains scripts designed to analyze Git repositories for team contributions over the last year, excluding merge commits. The scripts generate CSV reports that summarize lines of code changed, commit counts by author, and aggregate commit counts across all specified repositories.
generate_lines_changed.sh
: Generates reports summarizing lines added, removed, and net changes by each author.generate_commit_counts.sh
: Counts the number of commits made by each author.aggregate_commits.sh
: Aggregates commit counts across all repositories and outputs the summary to a CSV file.
- Git
- Bash shell
awk
utility (usually pre-installed on Linux and macOS)
- Clone or download these scripts to your local machine.
- Ensure the scripts are executable:
chmod +x generate_lines_changed.sh generate_commit_counts.sh aggregate_commits.sh
- Create a
repo_paths.conf
file in the same directory as the scripts. List the full path to each Git repository you wish to analyze, one per line.
- Run
generate_lines_changed.sh
from the terminal:./generate_lines_changed.sh
- The script creates a directory named
repo_lines_change_by_author
and generates a CSV report for each repository listed inrepo_paths.conf
, summarizing the lines of code changed by each author.
- Run
generate_commit_counts.sh
from the terminal:./generate_commit_counts.sh
- This script creates a directory named
repo_commit_counts_by_author
and generates a CSV report for each repository, listing the number of commits by each author.
- Run
aggregate_commits.sh
from the terminal:./aggregate_commits.sh
- This script processes all repositories listed in
repo_paths.conf
, aggregates commit counts by author across all repositories, and outputs the results toaggregate_commits.csv
.
- The
generate_lines_changed.sh
andgenerate_commit_counts.sh
scripts output files namedrepo_lines_changed_by_author_[repo_name].csv
andrepo_commit_counts_by_author_[repo_name].csv
, stored in their respective directories. - The
aggregate_commits.sh
script outputs a file namedaggregate_commits.csv
, summarizing aggregated commit counts by author across all specified repositories.
- All scripts exclude merge commits to focus on direct contributions with the exception of aggregate_commits.sh
- The analyses are based on contributions within the last year.
- Ensure your
repo_paths.conf
file contains valid Git repository paths for accurate analysis.