path: root/gitweb/Makefile
AgeCommit message (Collapse)Author
2020-12-09gitweb/Makefile: conditionally include ../GIT-VERSION-FILERamsay Jones
The 'clean' target is still noticeably slow on cygwin, despite the improvements made by previous patches. For example, the second invocation of 'make clean' below: $ make clean >/dev/null 2>&1 $ make clean ... make[1]: Entering directory '/home/ramsay/git/gitweb' make[2]: Entering directory '/home/ramsay/git' make[2]: 'GIT-VERSION-FILE' is up to date. make[2]: Leaving directory '/home/ramsay/git' ... $ has been timed at 10.361s on my laptop (an old core i5-4200M @ 2.50GHz, 8GB RAM, 1TB HDD). Notice that the 'clean' target is making a nested call to the parent Makefile to ensure that the GIT-VERSION-FILE is up-to-date. This is to ensure that the $(GIT_VERSION) make variable is set, once that file had been included. However, the 'clean' target does not use the $(GIT_VERSION) variable, directly or indirectly, so it does not have any affect on what the target removes. Therefore, the time spent on ensuring an up to date GIT-VERSION-FILE is wasted effort. In order to eliminate such wasted effort, use the value of the internal $(MAKECMDGOALS) variable to only '-include ../GIT-VERSION-FILE' when the target is not 'clean'. (This drops the time down to 8.430s, on my laptop, giving an improvement of 18.64%). Signed-off-by: Ramsay Jones <> Signed-off-by: Junio C Hamano <>
2011-10-27Merge branch 'rj/gitweb-clean-js'Junio C Hamano
* rj/gitweb-clean-js: gitweb/Makefile: Remove static/gitweb.js in the clean target
2011-10-26gitweb/Makefile: Remove static/gitweb.js in the clean targetRamsay Jones
Since 9a86dd5 (gitweb: Split JavaScript for maintability, combining on build, 2011-04-28), static/gitweb.js has been a build product that should be cleaned upon "make clean". Signed-off-by: Ramsay Jones <> Signed-off-by: Junio C Hamano <>
2011-10-21gitweb: provide a way to customize html headersLénaïc Huard
This allows web sites to add some specific html headers to the pages generated by gitweb. The new variable $site_html_head_string can be set to an html snippet that will be inserted at the end of the <head> section of each page generated by gitweb. Signed-off-by: Lénaïc Huard <> Signed-off-by: Junio C Hamano <>
2011-07-24gitweb: Introduce common system-wide settings for convenienceJakub Narebski
Because of backward compatibility we cannot change gitweb to always use /etc/gitweb.conf (i.e. even if gitweb_config.perl exists). For common system-wide settings we therefore need separate configuration file: /etc/gitweb-common.conf. Long description: gitweb currently obtains configuration from the following sources: 1. per-instance configuration file (default: gitweb_conf.perl) 2. system-wide configuration file (default: /etc/gitweb.conf) If per-instance configuration file exists, then system-wide configuration is _not used at all_. This is quite untypical and suprising behavior. Moreover it is different from way git itself treats /etc/git.conf. It reads in stuff from /etc/git.conf and then local repos can change or override things as needed. In fact this is quite beneficial, because it gives site admins a simple and easy way to give an automatic hint to a repo about things the admin would like. On the other hand changing current behavior may lead to the situation, where something in /etc/gitweb.conf may interfere with unintended interaction in the local repository. One solution would be to _require_ to do explicit include; with read_config_file() it is now easy, as described in gitweb/README (description introduced in this commit). But as J.H. noticed we cannot ask people to modify their per-instance gitweb config file to include system-wide settings, nor we can require them to do this. Therefore, as proposed by Junio, for gitweb to have centralized config elements while retaining backwards compatibility, introduce separate common system-wide configuration file, by default /etc/gitweb-common.conf Noticed-by: Drew Northup <> Helped-by: John 'Warthog9' Hawley <> Inspired-by: Junio C Hamano <> Signed-off-by: Jakub Narebski <> Signed-off-by: Junio C Hamano <>
2011-05-24gitweb: JavaScript ability to adjust time based on timezoneJohn 'Warthog9' Hawley
This patch is based on Kevin Cernekee's <> patch series entitled "gitweb: introduce localtime feature". While Kevin's patch changed the server side output so that the timezone was output from gitweb itself, this has a number of drawbacks, in particular with respect to gitweb-caching. This patch takes the same basic goal, display the appropriate times in a given common timezone, and implements it in JavaScript. This requires adding / using a new class, "datetime", to be able to find elements to be adjusted from JavaScript. Appropriate dates are wrapped in a span with this class. Timezone to be used can be retrieved from "gitweb_tz" cookie, though currently there is no way to set / manipulate this cookie from gitweb; this is left for later commit. Valid timezones, currently, are: "utc", "local" (which means that timezone is taken from browser), and "+/-ZZZZ" numeric timezone as in RFC-2822. Default timezone is "local" (currently not configurable, left for later commit). Fallback (should JavaScript not be enabled) is to treat dates as they have been and display them, only, in UTC. Pages affected: * 'summary' view, "last change" field (commit time from latest change) * 'log' view, author time * 'commit' and 'commitdiff' views, author/committer time * 'tag' view, tagger time Based-on-code-from: Kevin Cernekee <> Signed-off-by: John 'Warthog9' Hawley <> Signed-off-by: Jakub Narebski <> Signed-off-by: Junio C Hamano <>
2011-05-24gitweb.js: Introduce code to handle cookies from JavaScriptJakub Narebski
Introduced gitweb/static/js/cookies.js file provides functions for setting, getting and deleting cookies. Code taken from subsection "Cookies in JavaScript" of "Professional JavaScript for Web Developers" by Nicholas C. Zakas and from cookie plugin for jQuery (dual licensed under the MIT and GPL licenses). Signed-off-by: Jakub Narebski <> Signed-off-by: Junio C Hamano <>
2011-05-24gitweb.js: Extract and improve datetime handlingJakub Narebski
Move formatDateISOLocal(epoch, timezone) function (and also helper timezoneOffset(timezoneInfo) function it requires) from common-lib.js to datetime.js Add new functions: * localTimezoneOffset - to get browser timezone offset in seconds * localTimezoneInfo - to get browser timezone in '(+|-)HHMM' format * formatTimezoneInfo - turn offset in hours and minutes into '(+|-)HHMM' * parseRFC2822Date - to parse RFC-2822 dates that gitweb uses into epoch * formatDateRFC2882 - like formatDateISOLocal, only RFC-2822 format All those functions are meant to be used in future commit 'gitweb: javascript ability to adjust time based on timezone' An alternative would be to use e.g. Datejs ( library, or JavaScript framework that has date formatting (perhaps as a plugin). While at it escape '-' in character class inside tzRe regexp, as recommended by JSLint ( Signed-off-by: Jakub Narebski <> Signed-off-by: Junio C Hamano <>
2011-05-24gitweb: Split JavaScript for maintability, combining on buildJakub Narebski
Split originally single gitweb.js file into smaller files, each dealing with single issue / area of responsibility. This move should make gitweb's JavaScript code easier to maintain. For better webapp performance it is recommended[1][2][3] to combine JavaScript files. Do it during build time (in gitweb/Makefile), by straight concatenation of files into gitweb.js file (which is now ignored as being generated). This means that there are no changes to gitweb script itself - it still uses gitweb.js or gitweb.min.js, but now generated. [1]: "Minimize HTTP Requests" section [2]: "1. Combine external JavaScript files" [3]: "Combine Your Files" section. See also new gitweb/static/js/README file. Inspired-by-patch-by: John 'Warthog9' Hawley <> Signed-off-by: Jakub Narebski <> Signed-off-by: Junio C Hamano <>
2010-11-17Merge branch 'jn/gitweb-test'Junio C Hamano
* jn/gitweb-test: gitweb/Makefile: Include gitweb/config.mak gitweb/Makefile: Add 'test' and 'test-installed' targets t/ Add support for GITWEB_TEST_INSTALLED gitweb: Move call to evaluate_git_version after evaluate_gitweb_config
2010-09-30gitweb/Makefile: Include gitweb/config.makJakub Narebski
Allow for gitweb-specific Makefile config to reside in config.mak file in the 'gitweb/' subdirectory. This means that gitweb-specific build-time configuration variable can reside in gitweb-specific gitweb/config.mak Signed-off-by: Jakub Narebski <> Signed-off-by: Junio C Hamano <>
2010-09-30gitweb/Makefile: Add 'test' and 'test-installed' targetsJakub Narebski
The 'test-installed' target in gitweb/Makefile tests installed gitweb, using the same destination directory that 'install' target uses. The 'test' target is just a convenience wrapper invoking 'gitweb-test' target of t/Makefile. Signed-off-by: Jakub Narebski <> Signed-off-by: Junio C Hamano <>
2010-09-27Enable highlight executable path as a configuration optionChristopher Wilson
Allow build-time/run-time configuration of the highlight executable (must be the one from due to assumptions about parameters and output). Defaults to previous behavior which assumes that highlight is available on the server PATH. However, if this is not the case, the path to the highlight executable can be configured at build time as a configuration variable HIGHLIGHT_BIN = /path/to/highlight or at runtime by configuring GITWEB_CONFIG $highlight_bin = /path/to/highlight Signed-off-by: Christopher Wilson <> Acked-by: Jakub Narebski <> Signed-off-by: Junio C Hamano <>
2010-06-21Merge branch 'maint'Junio C Hamano
* maint: gitweb/Makefile: fix typo in gitweb.min.css rule Conflicts: gitweb/Makefile
2010-06-20gitweb/Makefile: fix typo in gitweb.min.css ruleJay Soffian
This typo has been in place since the rule was originally added by 0e6ce21 (Gitweb: add support for minifying gitweb.css). Signed-off-by: Jay Soffian <> Signed-off-by: Junio C Hamano <>
2010-06-01gitweb: Move static files into seperate subdirectoryPavan Kumar Sunkara
Create a new subdirectory called 'static' in gitweb/, and move all static files required by gitweb.cgi when running, which means styles, images and Javascript code. This should make gitweb more readable and easier to maintain. Update t/ to reflect this change.The install-gitweb now also include moving of static files into 'static' subdirectory in target directory: update Makefile, gitweb's INSTALL, README and Makefile accordingly. Signed-off-by: Pavan Kumar Sunkara <> Mentored-by: Christian Couder <> Mentored-by: Petr Baudis <> Acked-by: Jakub Narebski <> Acked-by: Petr Baudis <> Signed-off-by: Junio C Hamano <>
2010-05-01gitweb: Create install target for gitweb in MakefileJakub Narebski
Installing gitweb is now as easy as # make gitwebdir=/var/www/cgi-bin gitweb-install ;# as root The gitweb/INSTALL file was updated accordingly, to make use of this new target. Fix shell quoting, i.e. setting bindir_SQ etc., in gitweb/Makefile. Those variables were not used previously. Signed-off-by: Jakub Narebski <> Signed-off-by: Junio C Hamano <>
2010-04-17gitweb: simplify gitweb.min.* generation and clean-up rulesJunio C Hamano
GITWEB_CSS and GITWEB_JS are meant to be "what URI should the installed cgi script use to refer to the stylesheet and JavaScript", never "this is the name of the file we are building". Don't use them to decide what file to build minified versions in. While we are at it, lose FILES that is used only for "clean" target in a misguided way. "make clean" should try to remove all the potential build artifacts regardless of a minor configuration change. Instead of trying to remove only the build product "make clean" would have created if it were run without "clean", explicitly list the three potential build products for removal. Tested-by: Mark Rada <> Signed-off-by: Junio C Hamano <>
2010-04-03Gitweb: add autoconfigure support for minifiersMark Rada
This will allow users to set a JavaScript/CSS minifier when/if they run the autoconfigure script while building git. Signed-off-by: Mark Rada <> Signed-off-by: Junio C Hamano <>
2010-04-03Gitweb: add support for minifying gitweb.cssMark Rada
The build system added support minifying gitweb.js through a JavaScript minifier, but most minifiers come with support for minifying CSS files as well, so we should use it if we can. This patch will add the same facilities to gitweb.css that gitweb.js has for minification. That does not mean that they will use the same minifier though, as it is not safe to assume that all JavaScript minifiers will also minify CSS files. This patch also adds the GITWEB_PROGRAMS variable to the Makefile to keep a list of potential gitweb dependencies separate from OTHER_PROGRAMS when we need to know just the gitweb dependencies. Though the bandwidth savings will not be as dramatic as with the JavaScript minifier, every byte saved is important. Signed-off-by: Mark Rada <> Signed-off-by: Junio C Hamano <>
2010-01-30gitweb: Makefile improvementsJohn 'Warthog9' Hawley
Adjust the main Makefile so you can simply run make gitweb which in turn calls gitweb/Makefile. This means that in order to generate gitweb, you can simply run 'make' from gitweb subdirectory: cd gitweb make Targets gitweb/gitweb.cgi and (dependent on JSMIN being defined) gitweb/gitweb.min.js in main Makefile are preserved for backward compatibility. Signed-off-by: John 'Warthog9' Hawley <> Signed-off-by: Jakub Narebski <> Signed-off-by: Junio C Hamano <>