Subject: Re: GSOC Application [gitweb]

From: Jakub Narebski <[email-masked]>
Date: Mon, 19 Mar 2012 16:06:49 -0700 (PDT)

Philipp Abraham <[email-masked]> writes:

> For my application, I would like to focus on gitweb.
> Looking at this year's proposals [1] the point "Use JavaScript library
> / framework in gitweb" caught my interest.
> I scanned through the current javascript code used by gitweb and
> noticed that there's not too much going on currently.
> 
> There are only 2 components where JS is used: Adjusting the time zone
> and incrementally looking up the data for blame.

Well, there is 2 and a 1/2: there is also "JavaScript detection".

> Since including a JS library (like prototype.js or jQuery) and
> refactoring the (small) existing code base to use the lib's methods
> doesn't look enough for GSoC, I wanted to ask what would be the best
> idea for a project proposal.

All three components could be improved:

* "JavaScript detection" now rewrites all internal links after
  loading document.  Perhaps a better solution would be to install
  "live" onclick event handler that would capture clicking on
  internal links and only then add 'js=1'

* The UI for adjusting timezone could be improved using UI part of
  JavaScript library; also capturing of onclick could be improved.

* Incremental blame could be written in two parts: one as possibly
  emulated (via timer) onprogress for XHR, one as queuing visual
  updates based on received data

> Are there any additional features that you would like to see in gitweb?

* Client-side sorting of tables (e.g. list of projects), though at
  least for some JavaScript libraries that would hardly need any work
  beside intergrating visually with the rest of gitweb and disabling
  server-side sorting

* Client-side syntax highlighting of blob view.  The problem here is
  how gitweb splits putput into lines, and provides line numbers,
  instead of just dumping file contents inside some kind of
  <pre>...</pre> element.

* Some way of allowing to create a diff between two arbitrary
  revisions; this might need some changes in server-side, and
  knowledge of Perl.

  A subset of this could be something like history view in MediaWiki.

* Perhaps further refinement of highlighting changes in diff, or even
  implementing transforming ordinary unified diff into side-by-side
  diff entirely on client side.
 
* Some way of automatic extending of clickable area for places where
  we have single link in a cell or cell-like structure

> I thought about creating a graphical representation of the tree (as
> proposed on last years idea list [2]) additionally or in exchange for
> the first idea.
> Though I couldn't think of the perfect solution (from a technology
> point) yet.
> Possible technologies would be using SVG, html5 canvas element or
> dynamically manipulated DOM elements (best browser support but harder
> to realize). Using special characters like 'git log --graph' does,
> seems to look a bit too retro in a web application.

Or just use Raphael JavaScript library (http://raphaeljs.com)...

> What would you advice to maximize the chances of getting accepted to
> work on gitweb?

-- 
Jakub Narebski