# RFD: Shipping GitBrowser.js for instaweb

4 messages from 2010-05-02 to 2010-05-03. Participants: Michael J Gruber, Jakub Narebski.
Thread: https://gitlist.dev/t/23676

## Michael J Gruber, 2010-05-02 16:25

Subject: RFD: Shipping GitBrowser.js for instaweb
Message-ID: <4BDDA780.7090500@drmicha.warpmail.net>
URL: https://gitlist.dev/e/4BDDA780.7090500%40drmicha.warpmail.net

```
Heya ;)

I was wondering whether it would make sense to ship GitBrowser.js with
Git and how much it would take to do so.

My personal answer to the 1st Q is Yes: instaweb as well as simple
gitweb installs would benefit from a graphical DAG viewer.

About the required effort I have no clue: I find it difficult to see
through which repo contains current gitweb, current repo.or.cz mods, and
especially the GitBrowser integration bits. Maybe we could ship the
integration bits without the actual GitBrowser if that is more feasible?

Michael

```

## Jakub Narebski, 2010-05-02 20:14

Subject: Re: RFD: Shipping GitBrowser.js for instaweb
Message-ID: <m3wrvmf4ei.fsf@localhost.localdomain>
URL: https://gitlist.dev/e/m3wrvmf4ei.fsf%40localhost.localdomain
In-Reply-To: <4BDDA780.7090500@drmicha.warpmail.net>

```
Michael J Gruber <git@drmicha.warpmail.net> writes:

> I was wondering whether it would make sense to ship GitBrowser.js with
> Git and how much it would take to do so.
> 
> My personal answer to the 1st Q is Yes: instaweb as well as simple
> gitweb installs would benefit from a graphical DAG viewer.
> 
> About the required effort I have no clue: I find it difficult to see
> through which repo contains current gitweb, current repo.or.cz mods, and
> especially the GitBrowser integration bits. Maybe we could ship the
> integration bits without the actual GitBrowser if that is more feasible?

The integration parts are actually present in gitweb, I think.  It is
a matter of configuration to enable 'graphiclog' link like in
http://repo.or.cz

GitBrowser.js is not, I think, the best solution for having graphical
history in gitweb, but would do...

-- 
Jakub Narebski
Poland
ShadeHawk on #git

```

## Michael J Gruber, 2010-05-03 07:57

Subject: Re: RFD: Shipping GitBrowser.js for instaweb
Message-ID: <4BDE81D8.8070505@drmicha.warpmail.net>
URL: https://gitlist.dev/e/4BDE81D8.8070505%40drmicha.warpmail.net
In-Reply-To: <m3wrvmf4ei.fsf@localhost.localdomain>

```
Jakub Narebski venit, vidit, dixit 02.05.2010 22:14:
> Michael J Gruber <git@drmicha.warpmail.net> writes:
> 
>> I was wondering whether it would make sense to ship GitBrowser.js with
>> Git and how much it would take to do so.
>>
>> My personal answer to the 1st Q is Yes: instaweb as well as simple
>> gitweb installs would benefit from a graphical DAG viewer.
>>
>> About the required effort I have no clue: I find it difficult to see
>> through which repo contains current gitweb, current repo.or.cz mods, and
>> especially the GitBrowser integration bits. Maybe we could ship the
>> integration bits without the actual GitBrowser if that is more feasible?
> 
> The integration parts are actually present in gitweb, I think.  It is
> a matter of configuration to enable 'graphiclog' link like in
> http://repo.or.cz
> 
> GitBrowser.js is not, I think, the best solution for having graphical
> history in gitweb, but would do...

After having a more thorough look at it I agree... We don't want to
inflate $GIT_DIR/gitweb more than necessary.

But what are the alternatives? Something svg/canvas would be nice, I
guess. The ruby frontends with graphlog don't convince me at all
(neither performance-wise nor layout-wise).

Michael

```

## Jakub Narebski, 2010-05-03 19:12

Subject: Re: RFD: Shipping GitBrowser.js for instaweb
Message-ID: <201005032112.10682.jnareb@gmail.com>
URL: https://gitlist.dev/e/201005032112.10682.jnareb%40gmail.com
In-Reply-To: <4BDE81D8.8070505@drmicha.warpmail.net>

```
On Mon, 3 May 2010, Michael J Gruber wrote:
> Jakub Narebski venit, vidit, dixit 02.05.2010 22:14:
>> Michael J Gruber <git@drmicha.warpmail.net> writes:
>> 
>>> I was wondering whether it would make sense to ship GitBrowser.js with
>>> Git and how much it would take to do so.
>>>
>>> My personal answer to the 1st Q is Yes: instaweb as well as simple
>>> gitweb installs would benefit from a graphical DAG viewer.
>>>
>>> About the required effort I have no clue: I find it difficult to see
>>> through which repo contains current gitweb, current repo.or.cz mods, and
>>> especially the GitBrowser integration bits. Maybe we could ship the
>>> integration bits without the actual GitBrowser if that is more feasible?
>> 
>> The integration parts are actually present in gitweb, I think.  It is
>> a matter of configuration to enable 'graphiclog' link like in
>> http://repo.or.cz
>> 
>> GitBrowser.js is not, I think, the best solution for having graphical
>> history in gitweb, but would do...
> 
> After having a more thorough look at it I agree... We don't want to
> inflate $GIT_DIR/gitweb more than necessary.

Especially that GitBrowser.js (git-browser) does drawing in *JavaScript*,
and requires (included) extra wz_jsgraphics.js JavaScript library
(Walter Zorn's High Performance JavaScript Graphics Library).

> 
> But what are the alternatives? Something svg/canvas would be nice, I
> guess. The ruby frontends with graphlog don't convince me at all
> (neither performance-wise nor layout-wise).

1. Using SVG/canvas (probably with Flash as fallback for those web 
   browser that do not have support for canvas element and/or SVN)
   seems like overkill for gitk / qgit / "git log --graph" equivalent
   for gitweb... well, unless for something like interactive 'Network'
   graph on GitHub, see e.g. http://github.com/jquery/jquery/network

2. Gitweb could generate required images on-the-fly using one of graphics
   modules like GD (uses gd library), Imaginer, or Image::Imlib2 (uses
   imlib2 library).  GD is, I think, most commonly used and available.
   We would want to make it conditional on GD (and gd library) being
   available.

3. Gitweb could use some ready images, which would be composed to form
   graphical representation of history; it would probably use CSS to
   change color (and require support for opacity in CSS or transparent
   layer in PNG).  See also 4.

4. Gitweb could use Unicode characters for tree graphics like git-forest
   (http://dev.medozas.de/gitweb.cgi?p=hxtools;a=blob_plain;f=bin/git-forest)
   does (I think it uses box drawing characters U+2500-257F).  We could
   even borrow some code from git-forest, which is also in Perl 
   (by Jan Engelhardt).

5. Gitweb could use ASCII-art for drawing history, like "git log --graph"
   does... perhaps even by directly using (and probably postprocessing)
   git-log / git-rev-list output with the '--graph' option.  It could
   change (transform) ASCII-art to Unicode box drawing characters.

-- 
Jakub Narebski
Poland

```
