Subject: Re: [PATCH/RFC 10/10] gitweb: Create links leading to 'blame_incremental' using JavaScript

From: Jakub Narebski <[email-masked]>
Date: Sun, 26 Jul 2009 12:06:11 +0200

On Sat, 25 Jul 2009, Martin Koegler wrote:
> On Sat, Jul 25, 2009 at 12:44:10AM +0200, Jakub Narebski wrote:

> > TODO list:
> > * Perhaps put fixLinks() function in separate file gitweb.js.
> >   Should gitweb use single JavaScript file, or should it be split into
> >   more than one file?
> 
> The same question can be asked for gitweb itself:

Well, there is one important difference: gitweb itself is not send
over network to client.  JavaScript is.  (Although I'm not sure how
great it is of an issue, with browsers caching JavaScript.  Perhaps
one single file would be better idea.)

> 
> Why is it a single perl file and not splited in many different
> modules?

There are a few causes.

1. Gitweb (then gitweb.cgi) started as single file.  There is a bit
   of resistance to changing this, especially that splitting it might
   make it harder to interate changes from other people who still use
   single file gitweb (see for example gitweb fork at git.kernel.org
   history).

2. Having it all in single file make its easy to install and update.
   Well, it made more sense when only way to configure gitweb was to
   edit gitweb.cgi.  Now building gitweb.cgi is the task for build
   system, and the only thing left is to copy files in correct place
   (I think that there are distribution specific packages which makes
   installing gitweb as easy as "xxx install gitweb").

3. You would have to decide _how_ to split it into many different 
   modules.  Do you know any good examples?

-- 
Jakub Narebski
Poland