Except that's not how science is done. Some people are bad writers and just don't touch the paper at all. Sometimes you have a grad student do all the work for a paper and someone else writes it, or the majority (common in the first year or two, or with undergrads). Just because they had no or little commits should they not be the main author? They did the work after all.
Another example, my advisor doesn't like git. While writing papers I and my collaborators use git but send an email copy to my advisor. Clearly he's going to be on the paper because he's my advisor but you'll see zero commits from him.
I think it's just too easy to think that technology solves this in a trivial way. It's complicated. You have people from different eras working on things. And this is in a CS program, mind you. In different fields it gets much worse very quick.
Side note: go look at papers from top tier universities. You'll notice that they frequently cite colleagues at their University. Is this because they are gaming the system? Is it because they are doing the most related research (which is VERY common for a single University to work close)? Or is it a combination. In all likelihood it's a combination because citations matter. The h index is used in your performance because this is meant to be how impactful your paper is, but the system can definitely be manipulated (and likely isn't happening for malicious reasons nor necessarily unethical reasons)