Github-readme-stats: Has Linus Torvalds made literally 175 million commits?

Created on 9 Oct 2020  路  5Comments  路  Source: anuraghazra/github-readme-stats

Describe the bug
@torvalds joined GitHub on September 3, 2011, and makes 2000+ contributions every year (as seen on his profile) that sums up to about 22k. However, your badge shows that he has a total of 175308.6k commits, which is far from reality. Even the number itself is absurd- one who commits once every minute would need 333 years to achieve this number!

Expected behavior
"Total commits" shows a number that is comparable to the number of contributions given by Github.

Screenshots / Live demo link (paste the github-readme-stats link as markdown image)
image

Additional context
None

bug

Most helpful comment

haha nice observation, lol.
Thanks for reporting this, i think the commits are just 17k and the kFormatter is failed to parse it properly maybe.

plot twist: linus is actually 333years old

All 5 comments

haha nice observation, lol.
Thanks for reporting this, i think the commits are just 17k and the kFormatter is failed to parse it properly maybe.

plot twist: linus is actually 333years old

Okay so turns out, github returns this number from their server: 164882902 which should be correct since it's coming from their API.

and parsing it with a proper kFormatter results in "165M"

function nFormatter(num, digits) {
  var si = [
    { value: 1, symbol: "" },
    { value: 1E3, symbol: "k" },
    { value: 1E6, symbol: "M" },
    { value: 1E9, symbol: "G" },
    { value: 1E12, symbol: "T" },
    { value: 1E15, symbol: "P" },
    { value: 1E18, symbol: "E" }
  ];
  var rx = /\.0+$|(\.[0-9]*[1-9])0+$/;
  var i;
  for (i = si.length - 1; i > 0; i--) {
    if (num >= si[i].value) {
      break;
    }
  }
  return (num / si[i].value).toFixed(digits).replace(rx, "$1") + si[i].symbol;
}

nFormatter(164882902) // "165M"

Damn then linus is actually 333years old

Hmm that's weird... unless they have some bot that auto-commits to some secret repos that don't show up in the published contribution count. Even so those "secret" commits have made up 99.99% of the total 馃

Was this page helpful?
0 / 5 - 0 ratings

Related issues

harshagv picture harshagv  路  5Comments

deep5050 picture deep5050  路  3Comments

IvanHornung picture IvanHornung  路  3Comments

JoseDeFreitas picture JoseDeFreitas  路  7Comments

nathanchu picture nathanchu  路  5Comments