Ninja religions following of treating timestamps (mtime) as 'modified' marker makes it useless with Git and large projects.
You switched some branches back and forward? Enjoy your 20 minutes rebuild.
You switched some branches back and forward? Enjoy your 20 minutes rebuild.
That will fix the "switch branches back and forward" case :)
Hash-aware build systems like bazel, if that's what you're imputing, are a nightmare to work with and come with their own set of problems which make it much less appealing to work with than (some) limitations found in cmake+ninja