Glossary · Git history

What is bus factor?

Bus factor is the smallest number of people who would have to leave a project before work on it stalls because nobody left understands the code. A bus factor of 1 means one person holds knowledge no one else has. It is usually estimated per file or module from git history: how few authors account for most of the changes.

Last reviewed: November 2026

Also called Truck factor, Lottery factor, Knowledge silo

In depth Code ownership and bus factor from git: the full method, edge cases and what to do about a bus factor of 1.

How bus factor is measured

There is no single standard formula. The most common estimate counts authors in git history:

  1. For a file, count commits per author over a window of history.
  2. Sort authors by commit count, highest first.
  3. Add authors until they cover a set share of all commits (80% is a common cut-off).
  4. The number of authors you needed is the file's bus factor.

A worked example. billing/invoice.py has 50 commits in the window:

AuthorCommitsRunning share
Priya4182%
Sam694%
Lee3100%

Priya alone covers 82%, which passes 80%, so the file's bus factor is 1. If Priya had 35 commits (70%), you would need Sam as well and the bus factor would be 2.

For a whole project, the academic version is the truck factor algorithm of Avelino et al. (ICPC 2016): it assigns each file to the authors with a "degree of authorship" over it, then removes top authors one at a time until more than half of the files have no remaining author. The number removed is the project's truck factor.

Commit counts are a proxy. Line ownership from git blame is another, and the two can disagree: someone who rewrote a file in one large commit owns its lines but few of its commits.

Why bus factor matters

Bus factor turns "only Priya knows billing" from a hunch into a list you can act on. The files that matter are the ones with bus factor 1 that still change often: each change needs the one person who understands them, reviews stall when they are away, and the knowledge leaves with them. A file with bus factor 1 that nobody has touched in two years is usually fine.

How to measure bus factor yourself

You can get a per-file answer from git alone:

# Commits per author for one file, highest first
git shortlog -sn --no-merges -- billing/invoice.py

# Lines currently owned per author
git blame --line-porcelain billing/invoice.py | grep '^author ' | sort | uniq -c | sort -rn

Divide the top author's count by the total to get their share. For a whole repository, the open-source Truck-Factor tool from the Avelino et al. paper computes the project-level figure, and git-fame summarises line ownership per author. Both are free. Neither ranks files by how often they change, so you have to join the result with churn yourself. See the code ownership and bus factor tools roundup for tools that do the join.

How repowise measures bus factor

repowise computes bus factor per file when it indexes git history (up to 5,000 commits by default): the number of top authors needed to cover 80% of the file's commits. It also records the primary owner by git blame line share and the most active recent author.

  • Where you see it: the ownership view on the git intelligence page, get_context (owners per file) and get_risk over MCP, and repowise context <file> on the CLI.
  • Fading ownership: a code health detector fires when a still-changing file has bus factor 1 and its primary owner has gone quiet in recent commits. On small teams it stays low severity unless the file is also a hotspot, because bus factor 1 is normal there.
  • No model involved: the figure comes straight from git log and git blame, so the same history always gives the same number.

For a survey of real projects, see the bus factor of 35 popular open-source repos.

FREQUENTLY ASKED

Bus factor: questions

What does a bus factor of 1 mean?

One person wrote most of the code in question, so if they leave, nobody else knows it well. In repowise terms, a single author accounts for at least 80% of the file's commits in the indexed history. It is a risk only while the code still changes; a stable file one person wrote years ago rarely breaks.

Is bus factor the same as truck factor?

Yes. Truck factor, lottery factor and bus factor name the same measure. Research papers mostly say truck factor; teams mostly say bus factor.

What is a good bus factor?

There is no universal target. For the files that change most, 2 or more is the usual goal, so a second person can review and maintain them. On a two-person team, bus factor 1 is the normal state for most files and is not worth alarm.

How do you increase bus factor?

Spread changes to the riskiest files across more people: rotate reviewers onto them, pair on changes, and write down the decisions behind the code. Start with files that are both bus factor 1 and hotspots, because those combine knowledge risk with frequent change.

See it on your own repository.

Index a repository free and read the result for your own code and history. Rolling it out to a team? We will walk you through it.