... from actually traversing the /git/FOO.git directories Separating the gcc and sourceware and cygwin sides needs a bit of hackery.
For https://cygwin.com/cgit/cygwin-packages this is automated through gitolite which writes out /sourceware/www/sourceware/htdocs/cygwin/git-cygwin-packages/projects.list which is then picked up by cgit (there is no gitweb interface anymore for cygwin-packages since that was just horrendously slow). There is also https://git.dwarfstd.org/ (cgit only) which is also controlled by gitolite which writes out all public repos to /sourceware/projects/dwarfstd-home/projects.list so that is already automated.