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

[Patch 001/GSoC] Move static files into subdir

From
Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
Date
May 9, 2010, 13:56 UTC
Message-ID
<p2ze72faaa81005090656j593c3464v9ee1bb6432461efc@mail.gmail.com>
Hi,

It's been a while I mail to this list since I got GSoC. But I have been in contact with Christian and Petr (mentors) everyday. As I am having my vacation, I decided to statrt the project earlier itself. Here's is my first patch in the process of my GSoC.

One of my project goals is to split gitweb. This patch initiates the splitting.
PATCH:
>From e25db0b62b481e029354ad33af8f0615a8353633 Mon Sep 17 00:00:00 2001
From: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
Date: Wed, 5 May 2010 21:44:57 -0700
Subject: [PATCH] Gitweb: Move all static files into a seperate directory

This commit creates a new subdirectory called 'static' in gitweb which will contain all the static files required by gitweb.cgi while executing. By doing so, the gitweb source will be more readable and maintainable.

Also changed INSTALL, README, Makefile and test files according to this change.

Signed-off-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
---
 gitweb/INSTALL                      |   20 ++++++++++----------
 gitweb/Makefile                     |   20 ++++++++++----------
 gitweb/README                       |    8 ++++----
 gitweb/{ => static}/git-favicon.png |  Bin 115 -> 115 bytes
 gitweb/{ => static}/git-logo.png    |  Bin 207 -> 207 bytes
 gitweb/{ => static}/gitweb.css      |    0
 gitweb/{ => static}/gitweb.js       |    0
 t/gitweb-lib.sh                     |    6 +++---
 8 files changed, 27 insertions(+), 27 deletions(-)
 rename gitweb/{ => static}/git-favicon.png (100%)
 rename gitweb/{ => static}/git-logo.png (100%)
 rename gitweb/{ => static}/gitweb.css (100%)
 rename gitweb/{ => static}/gitweb.js (100%)
diff --git a/gitweb/INSTALL b/gitweb/INSTALL
index cbdc136..60c25ff 100644
--- a/gitweb/INSTALL
+++ b/gitweb/INSTALL
@@ -7,7 +7,8 @@ gitweb.css, git-logo.png and git-favicon.png) to their
destination.
 For example if git was (or is) installed with /usr prefix, you can do

 	$ make prefix=/usr gitweb             ;# as yourself
-	# cp gitweb/git* /var/www/cgi-bin/    ;# as root
+	# cp gitweb/gitweb.cgi /var/www/cgi-bin/   ;# as root
+	# cp -r gitweb/static /var/www/cgi-bin/    ;# as root

 Alternatively you can use autoconf generated ./configure script to
 set up path to git binaries (via config.mak.autogen), so you can write
@@ -16,7 +17,8 @@ instead
 	$ make configure                     ;# as yourself
 	$ ./configure --prefix=/usr          ;# as yourself
 	$ make gitweb                        ;# as yourself
-	# cp gitweb/git* /var/www/cgi-bin/   ;# as root
+	# cp gitweb/gitweb.cgi /var/www/cgi-bin/   ;# as root
+	# cp -r gitweb/static /var/www/cgi-bin/    ;# as root

 The above example assumes that your web server is configured to run
 [executable] files in /var/www/cgi-bin/ as server scripts (as CGI
@@ -79,17 +81,15 @@ Build example
   we want to display are under /home/local/scm, you can do

 	make GITWEB_PROJECTROOT="/home/local/scm" \
-	     GITWEB_JS="/gitweb/gitweb.js" \
-	     GITWEB_CSS="/gitweb/gitweb.css" \
-	     GITWEB_LOGO="/gitweb/git-logo.png" \
-	     GITWEB_FAVICON="/gitweb/git-favicon.png" \
+	     GITWEB_JS="/gitweb/static/gitweb.js" \
+	     GITWEB_CSS="/gitweb/static/gitweb.css" \
+	     GITWEB_LOGO="/gitweb/static/git-logo.png" \
+	     GITWEB_FAVICON="/gitweb/static/git-favicon.png" \
 	     bindir=/usr/local/bin \
 	     gitweb

-	cp -fv ~/git/gitweb/gitweb.{cgi,js,css} \
-	       ~/git/gitweb/git-{favicon,logo}.png \
-	     /var/www/cgi-bin/gitweb/
-
+	cp -fv gitweb/gitweb.cgi /var/www/cgi-bin/gitweb/
+	cp -r gitweb/static /var/www/cgi-bin/gitweb/

 Gitweb config file
 ------------------
diff --git a/gitweb/Makefile b/gitweb/Makefile
index f2e1d92..c0d5da3 100644
--- a/gitweb/Makefile
+++ b/gitweb/Makefile
@@ -26,10 +26,10 @@ GITWEB_STRICT_EXPORT =
 GITWEB_BASE_URL =
 GITWEB_LIST =
 GITWEB_HOMETEXT = indextext.html
-GITWEB_CSS = gitweb.css
-GITWEB_LOGO = git-logo.png
-GITWEB_FAVICON = git-favicon.png
-GITWEB_JS = gitweb.js
+GITWEB_CSS = static/gitweb.css
+GITWEB_LOGO = static/git-logo.png
+GITWEB_FAVICON = static/git-favicon.png
+GITWEB_JS = static/gitweb.js
 GITWEB_SITE_HEADER =
 GITWEB_SITE_FOOTER =

@@ -81,16 +81,16 @@ endif
 all:: gitweb.cgi

 ifdef JSMIN
-GITWEB_JS = gitweb.min.js
-all:: gitweb.min.js
-gitweb.min.js: gitweb.js GITWEB-BUILD-OPTIONS
+GITWEB_JS = static/gitweb.min.js
+all:: static/gitweb.min.js
+static/gitweb.min.js: static/gitweb.js GITWEB-BUILD-OPTIONS
 	$(QUIET_GEN)$(JSMIN) <$< >$@
 endif

 ifdef CSSMIN
-GITWEB_CSS = gitweb.min.css
-all:: gitweb.min.css
-gitweb.min.css: gitweb.css GITWEB-BUILD-OPTIONS
+GITWEB_CSS = static/gitweb.min.css
+all:: static/gitweb.min.css
+static/gitweb.min.css: static/gitweb.css GITWEB-BUILD-OPTIONS
 	$(QUIET_GEN)$(CSSMIN) <$ >$@
 endif

diff --git a/gitweb/README b/gitweb/README
index 71742b3..eeac204 100644
--- a/gitweb/README
+++ b/gitweb/README
@@ -80,23 +80,23 @@ You can specify the following configuration
variables when building GIT:
    Points to the location where you put gitweb.css on your web server
    (or to be more generic, the URI of gitweb stylesheet).  Relative to the
    base URI of gitweb.  Note that you can setup multiple stylesheets from
-   the gitweb config file.  [Default: gitweb.css (or gitweb.min.css if the
+   the gitweb config file.  [Default: static/gitweb.css (or
gitweb.min.css if the
    CSSMIN variable is defined / CSS minifier is used)]
  * GITWEB_LOGO
    Points to the location where you put git-logo.png on your web server
    (or to be more generic URI of logo, 72x27 size, displayed in top right
    corner of each gitweb page, and used as logo for Atom feed).  Relative
-   to base URI of gitweb.  [Default: git-logo.png]
+   to base URI of gitweb.  [Default: static/git-logo.png]
  * GITWEB_FAVICON
    Points to the location where you put git-favicon.png on your web server
    (or to be more generic URI of favicon, assumed to be image/png type;
    web browsers that support favicons (website icons) may display them
    in the browser's URL bar and next to site name in bookmarks).  Relative
-   to base URI of gitweb.  [Default: git-favicon.png]
+   to base URI of gitweb.  [Default: static/git-favicon.png]
  * GITWEB_JS
    Points to the localtion where you put gitweb.js on your web server
    (or to be more generic URI of JavaScript code used by gitweb).
-   Relative to base URI of gitweb.  [Default: gitweb.js (or gitweb.min.js
+   Relative to base URI of gitweb.  [Default: static/gitweb.js (or
gitweb.min.js
    if JSMIN build variable is defined / JavaScript minifier is used)]
  * GITWEB_CONFIG
    This Perl file will be loaded using 'do' and can be used to override any
diff --git a/gitweb/gitweb.css b/gitweb/static/gitweb.css
similarity index 100%
rename from gitweb/gitweb.css
rename to gitweb/static/gitweb.css
diff --git a/gitweb/gitweb.js b/gitweb/static/gitweb.js
similarity index 100%
rename from gitweb/gitweb.js
rename to gitweb/static/gitweb.js
diff --git a/t/gitweb-lib.sh b/t/gitweb-lib.sh
index 5a734b1..b70b891 100644
--- a/t/gitweb-lib.sh
+++ b/t/gitweb-lib.sh
@@ -19,9 +19,9 @@ our \$site_name = '[localhost]';
 our \$site_header = '';
 our \$site_footer = '';
 our \$home_text = 'indextext.html';
-our @stylesheets = ('file:///$TEST_DIRECTORY/../gitweb/gitweb.css');
-our \$logo = 'file:///$TEST_DIRECTORY/../gitweb/git-logo.png';
-our \$favicon = 'file:///$TEST_DIRECTORY/../gitweb/git-favicon.png';
+our @stylesheets = ('file:///$TEST_DIRECTORY/../gitweb/static/gitweb.css');
+our \$logo = 'file:///$TEST_DIRECTORY/../gitweb/static/git-logo.png';
+our \$favicon = 'file:///$TEST_DIRECTORY/../gitweb/static/git-favicon.png';
 our \$projects_list = '';
 our \$export_ok = '';
 our \$strict_export = '';
-- 
1.7.0.4
Next: Christian Couder
Message 1 of 17 in “Move static files into subdir”
  1. Move static files into subdirPavan Kumar Sunkara, May 9, 2010
  2. Christian CouderMay 9, 2010
  3. Pavan Kumar SunkaraMay 9, 2010
  4. Jakub NarebskiMay 9, 2010
  5. Pavan Kumar SunkaraMay 10, 2010
  6. Ramkumar RamachandraMay 10, 2010
  7. Jakub NarebskiMay 10, 2010
  8. Pavan Kumar SunkaraMay 10, 2010
  9. Jakub NarebskiMay 11, 2010
  10. Pavan Kumar SunkaraMay 12, 2010
  11. Pavan Kumar SunkaraMay 12, 2010
  12. Christian CouderMay 13, 2010
  13. Pavan Kumar SunkaraMay 13, 2010
  14. Pavan Kumar SunkaraMay 14, 2010
  15. Jakub NarebskiMay 14, 2010
  16. Pavan Kumar SunkaraMay 15, 2010
  17. Jakub NarebskiMay 18, 2010

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.