From: Martin Koegler <mkoegler@auto.tuwien.ac.at>
To: Jakub Narebski <jnareb@gmail.com>
Cc: git@vger.kernel.org, Petr Baudis <pasky@suse.cz>,
Fredrik Kuivinen <frekui@gmail.com>,
Giuseppe Bilotta <giuseppe.bilotta@gmail.com>,
Luben Tuikov <ltuikov@yahoo.com>
Subject: Re: [PATCH/RFC 10/10] gitweb: Create links leading to 'blame_incremental' using JavaScript
Date: Mon, 27 Jul 2009 20:10:46 +0200 [thread overview]
Message-ID: <20090727181046.GA30365@auto.tuwien.ac.at> (raw)
In-Reply-To: <200907261206.15646.jnareb@gmail.com>
On Sun, Jul 26, 2009 at 12:06:11PM +0200, Jakub Narebski wrote:
> 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.)
More files mean more request on the server. If the browser is
configured to check at each request, it will issue a GET for each
JavaScript file, which will be answered by a 304 after the first
request. In the "automatic mode", the browser waits for some time
(determined by a heuristic), before it will issue a GET for each file
request again.
So in my option, on (bigger) file is better, as it means fewer request.
> >
> > Why is it a single perl file and not splited in many different
> > modules?
>
> 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").
Yes, there are gitweb packages, which automaticially server
repositories under a specific path (eg. /srv/git). For such packages,
the js layout is irrelavant.
When manually installing, copying only one javascript file simplifies
the deployment.
> 3. You would have to decide _how_ to split it into many different
> modules. Do you know any good examples?
Javascript uses on global namespace. If it is one file, its implicitly
clear, that everything (functions, variables) are in one scope. If
you split it into multiple files, you have to remember, what the other
files contain.
mfg Martin Kögler
next prev parent reply other threads:[~2009-07-27 18:11 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-24 22:44 [PATCHv2 00/10] gitweb: 'blame' view improvements Jakub Narebski
2009-07-24 22:44 ` [PATCH 01/10] gitweb: Make .error style generic Jakub Narebski
2009-07-24 22:44 ` [PATCH 02/10] gitweb: Mark boundary commits in 'blame' view Jakub Narebski
2009-07-25 0:13 ` Junio C Hamano
2009-07-25 0:32 ` Jakub Narebski
2009-07-25 0:39 ` Junio C Hamano
2009-07-24 22:44 ` [PATCHv2 03/10] gitweb: Use "previous" header of git-blame -p " Jakub Narebski
2009-07-24 22:44 ` [PATCH 04/10] gitweb: Mark commits with no "previous" " Jakub Narebski
2009-07-24 22:44 ` [PATCHv2 05/10] gitweb: Add author initials in 'blame' view, a la "git gui blame" Jakub Narebski
2009-07-24 22:44 ` [PATCH/RFC 06/10] gitweb: Use light/dark for class names also in 'blame' view Jakub Narebski
2009-07-24 22:44 ` [PATCH 07/10] gitweb: Add -partial_query option to href() subroutine Jakub Narebski
2009-07-24 22:44 ` [PATCH 08/10] gitweb: Add optional "time to generate page" info in footer Jakub Narebski
2009-07-24 22:44 ` [PATCHv2/RFC 09/10] gitweb: Incremental blame (proof of concept) Jakub Narebski
2009-07-25 19:28 ` Jakub Narebski
2009-07-24 22:44 ` [PATCH/RFC 10/10] gitweb: Create links leading to 'blame_incremental' using JavaScript Jakub Narebski
2009-07-25 10:46 ` Martin Koegler
2009-07-26 10:06 ` Jakub Narebski
2009-07-27 18:10 ` Martin Koegler [this message]
2009-07-27 19:06 ` Jakub Narebski
2009-07-24 23:47 ` [PATCHv2 00/10] gitweb: 'blame' view improvements Junio C Hamano
2009-07-25 0:10 ` Jakub Narebski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090727181046.GA30365@auto.tuwien.ac.at \
--to=mkoegler@auto.tuwien.ac.at \
--cc=frekui@gmail.com \
--cc=git@vger.kernel.org \
--cc=giuseppe.bilotta@gmail.com \
--cc=jnareb@gmail.com \
--cc=ltuikov@yahoo.com \
--cc=pasky@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).