All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: Petr Baudis <pasky@suse.cz>
Cc: git@vger.kernel.org, Fredrik Kuivinen <frekui@gmail.com>,
	Giuseppe Bilotta <giuseppe.bilotta@gmail.com>,
	Luben Tuikov <ltuikov@yahoo.com>,
	Martin Koegler <mkoegler@auto.tuwien.ac.at>
Subject: Re: [PATCHv5 2/5] gitweb: Incremental blame (using JavaScript)
Date: Sat, 7 Nov 2009 12:04:51 +0100	[thread overview]
Message-ID: <200911071204.53550.jnareb@gmail.com> (raw)
In-Reply-To: <20091105202202.GC17748@machine.or.cz>

On Thu, 5 Nov 2009, Petr Baudis wrote:
> 
>   Many thanks for nurturing this patch.

You are welcome.

I have learned quite a bit about JavaScript when working on this
patch...
 
> On Tue, Sep 01, 2009 at 01:39:17PM +0200, Jakub Narebski wrote:
> > Roads not taken (perhaps that should be part of commit message?):
> > * Move most (or all) of "git blame --incremental" output parsing to
> >   server side, and instead of sending direct output in text/plain,
> >   send processed data in JSON format, e.g.
> > 
> >     {"commit": {
> >        "sha1": "e83c5163316f89bfbde7d9ab23ca2e25604af290",
> >        "info": "Kay Sievers, 2005-08-07 21:49:46 +0200",
> >        "author-initials": "KS",
> >        ...
> >      },
> >      "src-line": 13,
> >      "dst-line": 16,
> >      "numlines": 3,
> >      "filename": "README"
> >      }
> > 
> >   (line wrapping added for readibility).  This would require however
> >   taking care on Perl side to send properly formatted JSON, and on
> >   JavaScript side including json2.js code to read JSON in gitweb.js
> >   (unless we rely on eval).
> 
>   I don't know that much about web programming, what is wrong with
> relying on eval?

In general it is insecure.  In this specific situation it shouldn't.

[...]
> > * Using some lightweight JavaScript library (framework), like jQuery,
> >   Prototype, ExtJS, MooTools, etc.  One one hand side this means not
> >   having to worry about browser incompatibilities as this would be
> >   taken care of by library; on the other hand side we want gitweb to
> >   have as few dependences as possible.
> 
>   Normally, particular version of the library is simply included within
> the project. E.g. in Girocco, I use MooTools for the tiny bit of
> javascript I do. It is probably overkill to include it just for
> incremental blame, but if we ever do much more, I think the much easier
> web programming is worth the little trouble.

Alternate solution would be to load for example jQuery for example hosted
on Google as described in http://code.google.com/apis/ajaxlibs/documentation/

-- 
Jakub Narebski
Poland

      reply	other threads:[~2009-11-07 11:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-01 11:39 [PATCH 0/5] gitweb: Incremental blame series (1 Sep 09) Jakub Narebski
2009-09-01 11:39 ` [PATCHv2 1/5] gitweb: Add optional "time to generate page" info in footer Jakub Narebski
2009-09-01 11:39   ` [PATCHv5 2/5] gitweb: Incremental blame (using JavaScript) Jakub Narebski
2009-09-01 11:39     ` [PATCHv1 3/5] gitweb: Colorize 'blame_incremental' view during processing Jakub Narebski
2009-09-01 11:39       ` [PATCHv3/RFC 4/5] gitweb: Create links leading to 'blame_incremental' using JavaScript Jakub Narebski
2009-09-01 11:39         ` [PATCHv1/RFC 5/5] gitweb: Minify gitweb.js if JSMIN is defined Jakub Narebski
2009-11-05 20:33         ` [PATCHv3/RFC 4/5] gitweb: Create links leading to 'blame_incremental' using JavaScript Petr Baudis
2009-11-06 18:05           ` Jakub Narebski
2009-11-12  8:05             ` Junio C Hamano
2009-11-12  9:22               ` Jakub Narebski
2009-11-05 20:22     ` [PATCHv5 2/5] gitweb: Incremental blame (using JavaScript) Petr Baudis
2009-11-07 11:04       ` Jakub Narebski [this message]

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=200911071204.53550.jnareb@gmail.com \
    --to=jnareb@gmail.com \
    --cc=frekui@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=giuseppe.bilotta@gmail.com \
    --cc=ltuikov@yahoo.com \
    --cc=mkoegler@auto.tuwien.ac.at \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.