CGI scripts belong to ${MY_CGIBINDIR} (rendering the .htaccess file unneeded, since apache already sets the correct options there). Also you are missing virtual/httpd-cgi dependency.
It also causes (13)Permission denied: exec of '/var/www/localhost/htdocs/gitweb/gitweb.cgi' failed since the file is not marked executable.
gitweb is going the way of the dodo as per r1.8692 of package.mask - ferdy