The missing context whenever this comes up is the fact that it was a surprise one off.
If developers have no idea they're going to be graded by lines of code at some random future date that's a much different situation than saying you're going to give bonuses away every month based on how many lines of code were written.
Everyone knows the second is bad, it'll be gamed massively. The first one could be useful though.
And yes doing it as a one off is still problematic and you can think of all kinds of exceptions, but if you think the organization is full of dead weight in general and overhired massively, a crude stack ranking by lines of code is a pretty good metric for figuring out which (e.g.) 50% is the bottom.
I'd guess Elon and Linus's character sheets are more closely aligned on the same dimensions of intelligence than Linus would like to admit.
... Wait, does the author think that they are _actually_ the same person? If not, why the scare quotes?
Elon Musk is the best engineering manager this century. And a dickhead.
Edit: Just re-read the story. Going by the quote there, the interviewer lied about what Musk did and the story lies about what Torvalds actually said about him.