git-instaweb: add Python builtin http.server support
With this patch it is possible to launch git-instaweb by using
Python http.server CGI handler via `-d python` option.
git-instaweb generates a small wrapper around the http.server
(in GIT_DIR/gitweb/) that address a limitation of the CGI handler
where CGI scripts have to be in a cgi-bin subdirectory and
directory index can't be easily changed. To keep the implementation
small, gitweb is running on url `/cgi-bin/gitweb.cgi` and an automatic
redirection is done when opening `/`.
The generated wrapper is compatible with both Python 2 and 3.
Python is by default installed on most modern Linux distributions
which enables running `git instaweb -d python` without needing
anything else.
Signed-off-by: Arti Zirk <arti.zirk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>