Git Commands to Run Before Reading Any Code

Via Hacker News today was The Git Commands I Run Before Reading Any Code. I made a git-rep.sh script based on these:

#!/bin/bash

# 2026-04-09 jj5 - SEE: https://piechowski.io/post/git-commands-before-reading-code/

main() {

  set -euo pipefail;

  report 'What Changes the Most';
  git log --format=format: --name-only --since="1 year ago" | sort | uniq -c | sort -nr | head -20;

  report 'Who Built This';
  git shortlog -sn --no-merges;

  report 'Where Do Bugs Cluster';
  git log -i -E --grep="fix|bug|broken" --name-only --format='' | sort | uniq -c | sort -nr | head -20;

  report 'Is This Project Accelerating or Dying';
  git log --format='%ad' --date=format:'%Y-%m' | sort | uniq -c;

  report 'How Often Is the Team Firefighting';
  git log --oneline --since="1 year ago" | grep -iE 'revert|hotfix|emergency|rollback';

}

report() {

  echo;
  echo "$1":
  echo;

}

main "$@";