← Git Bus Factor Check

What is a bus factor (truck factor), and how do you raise it?

The bus factor is the smallest number of people who would have to leave before a project stalls because nobody left understands the code. It is a grim name for a planning question: where is our knowledge held by one head?

How it is measured from git history

Commit history cannot show who understands a file, but it shows who changed it. This tool adds up, per folder, the lines each person added and deleted. A single commit is capped at 500 lines per file so a generated or vendored dump cannot own a folder, and each change loses half its weight every 180 days so recent work counts for more. Bots, lock files, node_modules, vendor, dist and minified files are ignored. The folder's bus factor is the fewest people whose weighted changes reach half of its total. This is a heuristic line scan of history, not a measure of understanding.

The three statuses

Five ways to raise it

  1. Make the second person the reviewer on the next change in every single-owner folder.
  2. Pair on one real change there instead of scheduling a handover meeting.
  3. Write down what history cannot show: why it was built this way, how it is deployed, where the credentials live.
  4. Hand the next bug or on-call rotation for that area to someone new.
  5. Re-run the check monthly and watch the flagged list shrink; python3 busfactor.py --fail-on-orphaned works as a CI gate.

What this number does not tell you

Squashed commits credit one author for a team's work, pair programming credits one of two people, a contributor who commits under two emails counts as two, and an expert who reviews but rarely commits is invisible. Use the output to start a conversation about a folder, never to judge a person.