git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: The future of gitweb - part 2: JavaScript

From
Jakub Narebski <jnareb@gmail.com>
Date
Apr 18, 2011, 18:13 UTC
Message-ID
<201104182013.14475.jnareb@gmail.com>
In-Reply-To
<BANLkTin80KQzp9=2Bu4rxJSwcnUj-aXaHw@mail.gmail.com>
On Sun, 17 Apr 2011, Pau Garcia i Quiles wrote:
Show 14 quoted lines
> On Sun, Apr 17, 2011 at 4:59 PM, Jakub Narebski <jnareb@gmail.com> wrote:
> 
>>> My suggestion is going to be tremendously unpopular, but still: if I
>>> were to develop my own gitweb, I'd use Wt ( http://webtoolkit.eu ) +
>>> libgit2. In fact, there is a very basic gitweb-like example bundled
>>> with Wt sources, it's available online at
>>> http://www.webtoolkit.eu/wt/examples/git
>>
>> Well, nothing prevents you or anybody else from writing (yet another)
>> web interface in C++ + Wt + libgit2.
> 
> I do not have the slightest intention of doing that, at least not in
> my spare time. The existing interfaces (gitweb, cgit, etc) are good 
> enough for me. 
I can certainly understand that... ;-)
> I made the suggestion of going with Wt just in case a 
> rewrite of gitweb was in mind.

No, major rewrite of gitweb is certainly not on agenda. Besides IMVVHO rewriting a long-lived existing application / project from scratch is usually a bad idea; you would almost certainly repeat old mistakes. If code is bad enough that it hinders maintenance and development, it is better to do refactoring, trying to keep project working as it was.

The question was more about future features.
[...]
Show 8 quoted lines
>> BTW. do I understand correctly that Wt generates JavaScript code, in
>> similar vein to GWT for Java, or Pyjamas for Python?
> 
> Wt generates Javascript only if the visitor has Javascript enabled. If
> Javascript is not available, it will generate plain HTML pages, with
> "update" buttons, etc and it will do that automatically: there is no
> need for you to write code "if Javascript is available { ... } else {
> ... }".
Well, actually sometimes you need to know if JavaScript is available...
for example in the case of gitweb there is separate 'blame' view which
runs 'git blame --porcelain' which can take a while, and Ajax-y
'blame_incremental' which runs 'git cat-file -p' + 'git blame --incremental'
in background via XmlHttpRequest.  Different server-side reactions;
and doing both would be really counterproductive wrt. performance.
 
On the other hand it would be nice to write almost the same algorithm
of parsing 'git blame --porcelain' and 'git blame --incremental' output,
and of generating or manipulating output to the same look ONCE, and not
one time in Perl, one time in JavaScript.

Unfortunately I haven't found anything on CPAN that would be Perl equivalent of Java's GWT, C++'s Wt, or Python's Pyjamas... well except not quite here CGI::Ajax. Besides even using CGI::Ajax goes against current "no non-core dependencies" policy...

BTW. there is Continuity Perl web framework which I think is similar to Wt in that it manages state of web app like Wt does.

Show 6 quoted lines
> The advantage of Wt is you can compile a hypothetical gitwebwt as a
> static executable and the result will be a single executable file that
> depends only on libc (or libc + git, if you call git instead of
> linking to libgit.a or libgit2). Also, performance and memory
> requirements are very good, which is important for not-that-powerful
> devices such as routers, etc.
Nice.
-- 
Jakub Narebski
Poland
Previous: Pau Garcia i QuilesNext: Petr Baudis
Message 25 of 30 in “The future of gitweb (long term goals)”
  1. Jakub NarebskiFeb 14, 2011
  2. Michael J GruberFeb 15, 2011
  3. Jakub NarebskiFeb 21, 2011
  4. Michael J GruberFeb 23, 2011
  5. The future of git-instaweb (was: Re: The future of gitweb (long term goals))Jakub Narebski, Feb 25, 2011
  6. Ævar Arnfjörð BjarmasonFeb 22, 2011
  7. Jakub NarebskiFeb 22, 2011
  8. The future of gitweb - part 2: JavaScriptJakub Narebski, Apr 14, 2011
  9. Michał ŁowickiApr 14, 2011
  10. david@lang.hmApr 15, 2011
  11. Peter VereshaginApr 16, 2011
  12. Jakub NarebskiApr 16, 2011
  13. Peter VereshaginApr 16, 2011
  14. Jakub NarebskiApr 16, 2011
  15. Peter VereshaginApr 16, 2011
  16. Jakub NarebskiApr 16, 2011
  17. Jakub NarebskiApr 16, 2011
  18. Peter VereshaginApr 16, 2011
  19. Jakub NarebskiApr 17, 2011
  20. Gitweb != HTTP back-end {Was: Re: The future of gitweb - part 2: JavaScript}Drew Northup, Apr 20, 2011
  21. Jakub NarebskiApr 20, 2011
  22. Pau Garcia i QuilesApr 16, 2011
  23. Jakub NarebskiApr 17, 2011
  24. Pau Garcia i QuilesApr 17, 2011
  25. Jakub NarebskiApr 18, 2011
  26. Petr BaudisApr 17, 2011
  27. Jakub NarebskiApr 18, 2011
  28. Petr BaudisApr 18, 2011
  29. Jakub NarebskiApr 18, 2011
  30. Drew NorthupApr 20, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.