The Git Commands I Run Before Reading Any Code
I saw Ally’s article and she highlights 5 commands.
What Changes the Most
> git log --format=format: --name-only --since="1 year ago" | sort | uniq -c | sort -nr | head -20I run this from app/ or src/, not the repo root.
Lockfiles, changelogs, and generated code will dominate the list otherwise.
This can help determine how much activity a particular module is getting.
Who Built This
> git shortlog -sn --no-mergesThis is less useful to me since most of my projects I am the only contributor. However this can be really helpful when I am inspecting a new project/library to determine if I want to use it or now.
Where Do Bugs Cluster
> git log -i -E --grep="fix|bug|broken" --name-only --format='' | sort | uniq -c | sort -nr | head -20This is helpful to determine how often and how the contributors in a project fixes bugs. For my projects, this can be useful to see which modules I am getting the bugs.
Is This Project Accelerating or Dying
> git log --format='%ad' --date=format:'%Y-%m' | sort | uniq -cThis is useful looking at other projects and not my own. Knowing the amount of commits can be helpful for whether a library is active, maybe too active/volatile or is dying.
How Often Is the Team Firefighting
> git log --oneline --since="1 year ago" | grep -iE 'revert|hotfix|emergency|rollback'Again not so much for my projects but can give an indicator on how well a project is being ran.