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

[PATCH 0/2] gitweb: Begin splitting gitweb

From
Jakub Narebski <jnareb@gmail.com>
Date
Feb 1, 2011, 16:50 UTC
Message-ID
<1296579016-13356-1-git-send-email-jnareb@gmail.com>

Gitweb is currently next to largest file (after gitk) in git sources, more than 220K with more than 25,000 lines. Therefore adding any large feature that would require large amount of code added, like gitweb caching by J.H. and my rewrite of it, or "gitweb admin/write" [failed] GSoC 2010 project by Pavan Kumar Sunkara require for new code to be added as a separate module or module. Otherwise gitweb would fast become unmaintainable.

Not in all cases it would require splitting gitweb upfront. At least in the case of gitweb caching it doesn't. What must be done however is preparing the infrastructure for modular gitweb sources; to properly test such infrastructure we need at least one split gitweb module.

This series is intended to bring such infrastructure to gitweb, to prepare way for adding output caching to gitweb. Alternatively it can be thought as beginning of splitting gitweb into smaller submodules, for better maintability.

Table of contents:
~~~~~~~~~~~~~~~~~~
* [PATCH (version A) 1/2] gitweb: Prepare for splitting gitweb
    sub __DIR__ () {
    	File::Spec->rel2abs(join '', (File::Spec->splitpath(__FILE__))[0, 1]);
    }
    use lib __DIR__ . '/lib';
  Advantages:
  - no changes to t/gitweb-lib.sh, ability to run source version
    of gitweb without any changes
  
  Disadvantages:
  - supports only modules installed either alongside gitweb, or in one
    of PERL5LIB directories; no support for installing modules not
    alongside gitweb
  - because we cannot rely on FindBin::again being available nor on
    having Dir::Self installed, __DIR__ must be defined -- more code.
 
* [PATCH (version B) 1/2] gitweb: Prepare for splitting gitweb
    use lib $ENV{'GITWEBLIBDIR'} || "++GITWEBLIBDIR++";
  Advantages:
  - supports relocating gitweb modules (to gitweblibdir)
  - shortest code of all the cases
  Disadvantages:
  - required changes to t/gitweb-lib.sh to pick up gitweb modules
    by source version of gitweb
* [PATCH (version C) 1/2] gitweb: Prepare for splitting gitweb
    sub __DIR__ () {
    	File::Spec->rel2abs(join '', (File::Spec->splitpath(__FILE__))[0, 1]);
    }
    use lib __DIR__ . '/lib';
    use lib "++GITWEBLIBDIR++";
  Advantages:
  - can run source version of gitweb (gitweb/gitweb.perl) as a script simply
  - supports relocating gitweb modules (to gitweblibdir)
  Disadvantages:
  - most complicated code of all cases
* [PATCH (proof of concept) 2/2] gitweb: Create Gitweb::Util module
  Something to actually test previous patch(es) with... and I guess
  good start to splitting gitweb into smaller modules.
  All versions pass "make -C gitweb test" and "make -C gitweb test-installed"
  after "make -C gitweb install" / "make install-gitweb".
Shortlog:
~~~~~~~~~
Jakub Narebski (1):
  gitweb: Prepare for splitting gitweb
Pavan Kumar Sunkara (1):
  gitweb: Create Gitweb::Util module
Diffstat (for version C):
~~~~~~~~~~~~~~~~~~~~~~~~~
 gitweb/Makefile           |   22 +++++-
 gitweb/gitweb.perl        |  150 ++++-----------------------------------
 gitweb/lib/Gitweb/Util.pm |  177 +++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 210 insertions(+), 139 deletions(-)
 create mode 100644 gitweb/lib/Gitweb/Util.pm
-- 
1.7.3
Next: Jakub Narebski
Message 1 of 7 in “gitweb: Begin splitting gitweb”
  1. 0/2 gitweb: Begin splitting gitwebJakub Narebski, Feb 1, 2011
  2. 1/2 gitweb: Prepare for splitting gitwebJakub Narebski, Feb 1, 2011
  3. 1/2 gitweb: Prepare for splitting gitwebJakub Narebski, Feb 1, 2011
  4. 1/2 gitweb: Prepare for splitting gitwebJakub Narebski, Feb 1, 2011
  5. Alejandro R. SedeñoFeb 2, 2011
  6. Jakub NarebskiFeb 11, 2011
  7. 2/2 gitweb: Create Gitweb::Util moduleJakub Narebski, Feb 1, 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.