Skip to content

Commit

Permalink
Merge branch 'jn/gitweb-blame'
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Junio C Hamano committed Dec 1, 2009
2 parents 9eba92f + 87e573f commit 8678bc0
Show file tree
Hide file tree
Showing 6 changed files with 1,173 additions and 88 deletions.
26 changes: 25 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@ all::
#
# Define NO_REGEX if you have no or inferior regex support in your C library.
#
# Define JSMIN to point to JavaScript minifier that functions as
# a filter to have gitweb.js minified.
#
# Define DEFAULT_PAGER to a sensible pager command (defaults to "less") if
# you want to use something different. The value will be interpreted by the
# shell at runtime when it is used.
Expand Down Expand Up @@ -274,6 +277,9 @@ lib = lib
# DESTDIR=
pathsep = :

# JavaScript minifier invocation that can function as filter
JSMIN =

# default configuration for gitweb
GITWEB_CONFIG = gitweb_config.perl
GITWEB_CONFIG_SYSTEM = /etc/gitweb.conf
Expand All @@ -289,6 +295,11 @@ GITWEB_HOMETEXT = indextext.html
GITWEB_CSS = gitweb.css
GITWEB_LOGO = git-logo.png
GITWEB_FAVICON = git-favicon.png
ifdef JSMIN
GITWEB_JS = gitweb.min.js
else
GITWEB_JS = gitweb.js
endif
GITWEB_SITE_HEADER =
GITWEB_SITE_FOOTER =

Expand Down Expand Up @@ -1498,8 +1509,13 @@ $(patsubst %.perl,%,$(SCRIPT_PERL)): % : %.perl
chmod +x $@+ && \
mv $@+ $@

ifdef JSMIN
OTHER_PROGRAMS += gitweb/gitweb.cgi gitweb/gitweb.min.js
gitweb/gitweb.cgi: gitweb/gitweb.perl gitweb/gitweb.min.js
else
OTHER_PROGRAMS += gitweb/gitweb.cgi
gitweb/gitweb.cgi: gitweb/gitweb.perl
endif
$(QUIET_GEN)$(RM) $@ $@+ && \
sed -e '1s|#!.*perl|#!$(PERL_PATH_SQ)|' \
-e 's|++GIT_VERSION++|$(GIT_VERSION)|g' \
Expand All @@ -1518,13 +1534,14 @@ gitweb/gitweb.cgi: gitweb/gitweb.perl
-e 's|++GITWEB_CSS++|$(GITWEB_CSS)|g' \
-e 's|++GITWEB_LOGO++|$(GITWEB_LOGO)|g' \
-e 's|++GITWEB_FAVICON++|$(GITWEB_FAVICON)|g' \
-e 's|++GITWEB_JS++|$(GITWEB_JS)|g' \
-e 's|++GITWEB_SITE_HEADER++|$(GITWEB_SITE_HEADER)|g' \
-e 's|++GITWEB_SITE_FOOTER++|$(GITWEB_SITE_FOOTER)|g' \
$< >$@+ && \
chmod +x $@+ && \
mv $@+ $@

git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css
git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css gitweb/gitweb.js
$(QUIET_GEN)$(RM) $@ $@+ && \
sed -e '1s|#!.*/sh|#!$(SHELL_PATH_SQ)|' \
-e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
Expand All @@ -1533,6 +1550,8 @@ git-instaweb: git-instaweb.sh gitweb/gitweb.cgi gitweb/gitweb.css
-e '/@@GITWEB_CGI@@/d' \
-e '/@@GITWEB_CSS@@/r gitweb/gitweb.css' \
-e '/@@GITWEB_CSS@@/d' \
-e '/@@GITWEB_JS@@/r gitweb/gitweb.js' \
-e '/@@GITWEB_JS@@/d' \
-e 's|@@PERL@@|$(PERL_PATH_SQ)|g' \
$@.sh > $@+ && \
chmod +x $@+ && \
Expand All @@ -1547,6 +1566,11 @@ $(patsubst %.perl,%,$(SCRIPT_PERL)) git-instaweb: % : unimplemented.sh
mv $@+ $@
endif # NO_PERL

ifdef JSMIN
gitweb/gitweb.min.js: gitweb/gitweb.js
$(QUIET_GEN)$(JSMIN) <$< >$@
endif # JSMIN

configure: configure.ac
$(QUIET_GEN)$(RM) $@ $<+ && \
sed -e 's/@@GIT_VERSION@@/$(GIT_VERSION)/g' \
Expand Down
7 changes: 7 additions & 0 deletions git-instaweb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -394,8 +394,15 @@ gitweb_css () {
EOFGITWEB
}

gitweb_js () {
cat > "$1" <<\EOFGITWEB
@@GITWEB_JS@@
EOFGITWEB
}

gitweb_cgi "$GIT_DIR/gitweb/gitweb.cgi"
gitweb_css "$GIT_DIR/gitweb/gitweb.css"
gitweb_js "$GIT_DIR/gitweb/gitweb.js"

case "$httpd" in
*lighttpd*)
Expand Down
4 changes: 4 additions & 0 deletions gitweb/README
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ You can specify the following configuration variables when building GIT:
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]
* 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]
* GITWEB_CONFIG
This Perl file will be loaded using 'do' and can be used to override any
of the options above as well as some other options -- see the "Runtime
Expand Down
23 changes: 23 additions & 0 deletions gitweb/gitweb.css
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ div.page_footer_text {
font-style: italic;
}

div#generating_info {
margin: 4px;
font-size: smaller;
text-align: center;
color: #505050;
}

div.page_body {
padding: 8px;
font-family: monospace;
Expand Down Expand Up @@ -254,6 +261,11 @@ tr.no-previous td.linenr {
font-weight: bold;
}

/* for 'blame_incremental', during processing */
tr.color1 { background-color: #f6fff6; }
tr.color2 { background-color: #f6f6ff; }
tr.color3 { background-color: #fff6f6; }

td {
padding: 2px 5px;
font-size: 100%;
Expand Down Expand Up @@ -345,6 +357,17 @@ td.mode {
font-family: monospace;
}

/* progress of blame_interactive */
div#progress_bar {
height: 2px;
margin-bottom: -2px;
background-color: #d8d9d0;
}
div#progress_info {
float: right;
text-align: right;
}

/* format of (optional) objects size in 'tree' view */
td.size {
font-family: monospace;
Expand Down
Loading

0 comments on commit 8678bc0

Please sign in to comment.