← notes

"Has this person committed anything" has no correct answer

May 8, 2023

Answer "has this GitHub username committed anything, and how much" as a package.

Returns hasCommits and commitCount. The interesting part is that the question has no correct answer, and the ways it is wrong are systematic rather than random.

The contributions graph is not an API. Commits to private repositories are invisible to a token that cannot see them. Commits authored under an email not attached to the account are not attributed at all, which covers anyone who ever committed from a work laptop with a different git config. The search API caps and rate-limits differently from REST, so the two disagree about the same person. The implementation uses a token, which means the same username returns different numbers depending on who is asking.

Whichever endpoint you pick, there is a population of real, active developers it reports as zero, contractors with private client work, anyone who changed their email, anyone whose work is on a company’s internal instance.

Which is the thing to say, given the obvious use. The number is fine as a rough signal and must not gate anything, because the people it is wrong about are not a random sample.

Published to npm.