Skip to content

Commit 8678bc0

Browse files
committed
Merge branch 'jn/gitweb-blame'
* jn/gitweb-blame: gitweb: Add link to other blame implementation in blame views gitweb: Make linking to actions requiring JavaScript a feature gitweb.js: fix padLeftStr() and its usage gitweb.js: Harden setting blamed commit info in incremental blame gitweb.js: fix null object exception in initials calculation gitweb: Minify gitweb.js if JSMIN is defined gitweb: Create links leading to 'blame_incremental' using JavaScript gitweb: Colorize 'blame_incremental' view during processing gitweb: Incremental blame (using JavaScript) gitweb: Add optional "time to generate page" info in footer Conflicts: Makefile gitweb/gitweb.css
2 parents 9eba92f + 87e573f commit 8678bc0

File tree

6 files changed

+1173
-88
lines changed

6 files changed

+1173
-88
lines changed

Makefile

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,9 @@ all::
205205
#
206206
# Define NO_REGEX if you have no or inferior regex support in your C library.
207207
#
208+
# Define JSMIN to point to JavaScript minifier that functions as
209+
# a filter to have gitweb.js minified.
210+
#
208211
# Define DEFAULT_PAGER to a sensible pager command (defaults to "less") if
209212
# you want to use something different. The value will be interpreted by the
210213
# shell at runtime when it is used.
@@ -274,6 +277,9 @@ lib = lib
274277
# DESTDIR=
275278
pathsep = :
276279

280+
# JavaScript minifier invocation that can function as filter
281+
JSMIN =
282+
277283
# default configuration for gitweb
278284
GITWEB_CONFIG = gitweb_config.perl
279285
GITWEB_CONFIG_SYSTEM = /etc/gitweb.conf
@@ -289,6 +295,11 @@ GITWEB_HOMETEXT = indextext.html
289295
GITWEB_CSS = gitweb.css
290296
GITWEB_LOGO = git-logo.png
291297
GITWEB_FAVICON = git-favicon.png
298+
ifdef JSMIN
299+
GITWEB_JS = gitweb.min.js
300+
else
301+
GITWEB_JS = gitweb.js
302+
endif
292303
GITWEB_SITE_HEADER =
293304
GITWEB_SITE_FOOTER =
294305

@@ -1498,8 +1509,13 @@ $(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl
14981509
chmod +x $@+ && \
14991510
mv $@+ $@
15001511

1512+
ifdef JSMIN
1513+
OTHER_PROGRAMS += gitweb/gitweb.cgi gitweb/gitweb.min.js
1514+
gitweb/gitweb.cgi: gitweb/gitweb.perl gitweb/gitweb.min.js
1515+
else
15011516
OTHER_PROGRAMS += gitweb/gitweb.cgi
15021517
gitweb/gitweb.cgi: gitweb/gitweb.perl
1518+
endif
15031519
$(QUIET_GEN)$(RM) $@ $@+ && \
15041520
sed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \
15051521
-e 's|++GIT_VERSION++|$(GIT_VERSION)|g' \
@@ -1518,13 +1534,14 @@ gitweb/gitweb.cgi: gitweb/gitweb.perl
15181534
-e 's|++GITWEB_CSS++|$(GITWEB_CSS)|g' \
15191535
-e 's|++GITWEB_LOGO++|$(GITWEB_LOGO)|g' \
15201536
-e 's|++GITWEB_FAVICON++|$(GITWEB_FAVICON)|g' \
1537+
-e 's|++GITWEB_JS++|$(GITWEB_JS)|g' \
15211538
-e 's|++GITWEB_SITE_HEADER++|$(GITWEB_SITE_HEADER)|g' \
15221539
-e 's|++GITWEB_SITE_FOOTER++|$(GITWEB_SITE_FOOTER)|g' \
15231540
$< >$@+ && \
15241541
chmod +x $@+ && \
15251542
mv $@+ $@
15261543

1527-
git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css
1544+
git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css gitweb/gitweb.js
15281545
$(QUIET_GEN)$(RM) $@ $@+ && \
15291546
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
15301547
-e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
@@ -1533,6 +1550,8 @@ git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css
15331550
-e '/@@GITWEB_CGI@@/d' \
15341551
-e '/@@GITWEB_CSS@@/r gitweb/gitweb.css' \
15351552
-e '/@@GITWEB_CSS@@/d' \
1553+
-e '/@@GITWEB_JS@@/r gitweb/gitweb.js' \
1554+
-e '/@@GITWEB_JS@@/d' \
15361555
-e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \
15371556
$@.sh > $@+ && \
15381557
chmod +x $@+ && \
@@ -1547,6 +1566,11 @@ $(patsubst %.perl,%,$(SCRIPT_PERL)) git-instaweb: % : unimplemented.sh
15471566
mv $@+ $@
15481567
endif # NO_PERL
15491568

1569+
ifdef JSMIN
1570+
gitweb/gitweb.min.js: gitweb/gitweb.js
1571+
$(QUIET_GEN)$(JSMIN) <$< >$@
1572+
endif # JSMIN
1573+
15501574
configure: configure.ac
15511575
$(QUIET_GEN)$(RM) $@ $<+ && \
15521576
sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \

git-instaweb.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,8 +394,15 @@ gitweb_css () {
394394
EOFGITWEB
395395
}
396396

397+
gitweb_js () {
398+
cat > "$1" <<\EOFGITWEB
399+
@@GITWEB_JS@@
400+
EOFGITWEB
401+
}
402+
397403
gitweb_cgi "$GIT_DIR/gitweb/gitweb.cgi"
398404
gitweb_css "$GIT_DIR/gitweb/gitweb.css"
405+
gitweb_js "$GIT_DIR/gitweb/gitweb.js"
399406

400407
case "$httpd" in
401408
*lighttpd*)

gitweb/README

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,10 @@ You can specify the following configuration variables when building GIT:
9292
web browsers that support favicons (website icons) may display them
9393
in the browser's URL bar and next to site name in bookmarks). Relative
9494
to base URI of gitweb. [Default: git-favicon.png]
95+
* GITWEB_JS
96+
Points to the localtion where you put gitweb.js on your web server
97+
(or to be more generic URI of JavaScript code used by gitweb).
98+
Relative to base URI of gitweb. [Default: gitweb.js]
9599
* GITWEB_CONFIG
96100
This Perl file will be loaded using 'do' and can be used to override any
97101
of the options above as well as some other options -- see the "Runtime

gitweb/gitweb.css

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,13 @@ div.page_footer_text {
7979
font-style: italic;
8080
}
8181

82+
div#generating_info {
83+
margin: 4px;
84+
font-size: smaller;
85+
text-align: center;
86+
color: #505050;
87+
}
88+
8289
div.page_body {
8390
padding: 8px;
8491
font-family: monospace;
@@ -254,6 +261,11 @@ tr.no-previous td.linenr {
254261
font-weight: bold;
255262
}
256263

264+
/* for 'blame_incremental', during processing */
265+
tr.color1 { background-color: #f6fff6; }
266+
tr.color2 { background-color: #f6f6ff; }
267+
tr.color3 { background-color: #fff6f6; }
268+
257269
td {
258270
padding: 2px 5px;
259271
font-size: 100%;
@@ -345,6 +357,17 @@ td.mode {
345357
font-family: monospace;
346358
}
347359

360+
/* progress of blame_interactive */
361+
div#progress_bar {
362+
height: 2px;
363+
margin-bottom: -2px;
364+
background-color: #d8d9d0;
365+
}
366+
div#progress_info {
367+
float: right;
368+
text-align: right;
369+
}
370+
348371
/* format of (optional) objects size in 'tree' view */
349372
td.size {
350373
font-family: monospace;

0 commit comments

Comments
 (0)