TL;DR
- Bus factor is the fewest people who together made 80% of a file's commits; a bus factor of 1 means one person made 80% or more of them.
- In the median of 195 popular open-source repos (1,000+ GitHub stars), 60% of production files have a bus factor of 1, and in 124 of the 195 those files are the majority.
- Busy files are more shared: in the median repo, 25% of hotspot files have a bus factor of 1.
- Numbers come from repowise's index of those 195 repos (November 2026), plus a
git shortlogscript run on a full clone of Django.
Bus factor (also called truck factor) is the number of people who would have to disappear before nobody left understands a piece of code. A bus factor of 1 means one person holds it.
It sounds like a warning sign. Across 195 popular open-source repositories, it is the normal state of most files.
How do you calculate bus factor?
For a single file: the fewest authors who together made 80% of its commits. If one person made 80% or more of the commits, the file has a bus factor of 1. If it takes two people to reach 80%, it is 2, and so on.
Commits are a rough proxy for knowledge, but every repo already has them. git blame is worse for this, because a formatter run or a big rename hands whole files to whoever pressed the button.
Compute it for one file
git shortlog -sn counts commits per author and sorts them, highest first. Walk down that list until you pass 80%:
#!/usr/bin/env bash
# busfactor.sh <file> [git log options]
f="$1"; shift
git shortlog -sn --no-merges "$@" HEAD -- "$f" |
awk '{c[NR] = $1; t += $1}
END {for (i = 1; i <= NR; i++) {s += c[i]; if (s >= 0.8 * t) {print i; exit}}}'
On a full clone of Django (HEAD 6a8248f, 10 November 2026), for the QuerySet module:
$ ./busfactor.sh django/db/models/query.py
54
$ ./busfactor.sh django/db/models/query.py --since="2 years ago"
20
Fifty-four people made 80% of the commits to query.py over 21 years, and 20 people over the last two. That is about as far from 1 as a file gets.
Two details matter in that script. HEAD is explicit because git shortlog with no revision reads standard input when it is not attached to a terminal, which inside a script means it prints nothing. And the --since option is not decoration. The people who wrote a file in 2012 are not necessarily the people who could fix it today, so the window you pick changes the answer.
Run it over every .py file under django/:
git ls-files 'django/*.py' | while read -r f; do
echo "$(./busfactor.sh "$f") $f"
done | awk '$1 == 1 {b++} END {print b " of " NR " files have bus factor 1"}'
151 of 909 files have bus factor 1
Now the same loop with --since="2 years ago" passed through, counting only the files that had commits in that window:
git ls-files 'django/*.py' | while read -r f; do
echo "$(./busfactor.sh "$f" --since="2 years ago") $f"
done | awk 'NF == 2 {n++; if ($1 == 1) b++} END {print b " of " n " files with commits have bus factor 1"}'
136 of 460 files with commits have bus factor 1
17% over Django's whole history, 30% over the last two years. Same code, same rule, a different window. Django is also one of the most widely shared codebases in open source. Most projects look different.
How common is a bus factor of 1 in open source?
I looked at production source files (tests, generated and vendored code excluded) in 195 public repositories with 1,000+ GitHub stars each, using the same 80% rule on each repo's indexed git history.
- In the median repo, 60% of production files have a bus factor of 1.
- In 124 of the 195 repos (64%), files with a bus factor of 1 are the majority.
By primary language (GitHub's label for the repo), median share of production files with a bus factor of 1:
| Language | Repos | Files with bus factor 1 |
|---|---|---|
| Rust | 15 | 79% |
| TypeScript | 52 | 70% |
| C# | 10 | 66% (small group, indicative) |
| Python | 51 | 57% |
| Go | 22 | 49% |
| JavaScript | 13 | 45% (small group, indicative) |
| C++ | 8 | 44% (small group, indicative) |
| All 195 | 195 | 60% |
I would not read too much into the language order. Bus factor depends heavily on how long a project has existed and how many regular contributors it has, and those vary more between repos than between languages. A three-year-old project has had far less time to spread knowledge around than Django has in 21.
Are the most-changed files single-owner?
The more useful number is about hotspots, the files that change most often. If the busiest files were also single-owner, that would be a real risk: lots of change going through one person's head.
The data says the opposite. In the median repo, 25% of hotspot files have a bus factor of 1, against 60% of all production files. Pooled across the 195 repos, 34% of 20,941 hotspot files are single-owner. Code that changes a lot tends to get touched by more people, which is what you would hope.
So a bus factor of 1 on a file nobody edits is mostly fine. The case worth acting on is a file that is still changing often while its main author has gone quiet.
What should you do about a bus factor of 1?
- Find the overlap first: files with a bus factor of 1 that are also in the top 10% by recent churn (lines added plus deleted in the last 90 days, which
git log --numstatgives you). Start with that list. - Route reviews on those files to a second person on purpose, even when the owner could review alone.
- Ask the owner for a short note on intent: why it is shaped like this, what not to change. Ten lines in a docstring or an ADR outlast a handover meeting.
- Do not chase a number. A bus factor of 2 on a stable utility file is not worth a reorg.
The full method, including .mailmap for people with several email addresses and how to run this across a whole repo, is in this guide on measuring bus factor from git. For a large repo you can browse, Grafana's owners page shows bus factor per file across its 10,000+ production files. At its last index, 24% of them had a bus factor of 1, well under the median.
How does your team handle single-owner files that still change every week?
How I got these numbers
The cohort is 195 of the most-starred public repositories indexed on repowise (1,000+ GitHub stars each, 253,688 production source files, November 2026), each measured at its own latest index between May and November 2026. The cohort-wide ownership numbers are finding 8 of the code health 2026 report. Bus factor is computed per production file from each repo's indexed git history with the 80% rule above. No author names were collected or used. The Django runs are the script above on a full clone at 6a8248f.
FAQ
What does the term bus factor mean?
Bus factor, also called truck factor, is the number of people who would have to leave a project before nobody left understands a piece of code. Here it is measured per file as the fewest authors who together made 80% of its commits.
How do you calculate bus factor from git?
Run git shortlog -sn --no-merges HEAD -- <file> to count commits per author, highest first, then add authors down the list until you pass 80% of the commits. The number of authors you needed is the bus factor. Add --since to measure only recent history.
Is a bus factor of 1 bad?
Not on its own. It is the normal state of 60% of production files in the median popular repo, and a single-owner file nobody edits is mostly fine. The case to act on is a file that still changes often while its main author has gone quiet.
Top comments (1)
The Django contrast is striking: 54 authors over 21 years for query.py, but 20 over the last two, and 17% of files at bus factor 1 over all history versus 30% in the last two years. That raises a question about the --since window: for a stable file that has not changed in two years, a recent window could understate who still understands it, while a full-history window overstates who could still fix it today. How should a team pick the window when the goal is finding who can actually maintain a file now, rather than who wrote it? A related question on hotspots: the top 10% by recent churn is the overlap worth acting on, but is churn counted by commits or by lines changed? A file with many small commits and a file with a few large refactors would rank very differently, and that choice seems to decide which single-owner files get a second reviewer first.