summaryrefslogtreecommitdiff
path: root/gitweb/gitweb.cgi
Commit message (Collapse)AuthorAgeFilesLines
* gitweb: fill in gitweb configuration by MakefileMartin Waitz2006-08-011-2598/+0
| | | | | | | | | | | | Generate gitweb/gitweb.cgi to reduce the need to patch gitweb.cgi by the end user. The GIT installation directory is already known by the Makefile, and can be inserted directly into gitweb. All other gitweb configuration parameters can now be specified by providing GITWEB_* variables while building GIT. These are described in gitweb/README. Signed-off-by: Martin Waitz <tali@admingilde.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Refactoring git_project_listJakub Narebski2006-07-311-22/+35
| | | | | | | | Slightly reworking git_project_list, including moving setting $order, as it is used only in this action. Mostly reindent. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: avoid undefined value warning in print_page_pathJunio C Hamano2006-07-311-3/+3
| | | | | | | The function unconditionally tried to match $type but some callers did not pass it. Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: when showing history of a tree, show tree link not blobJunio C Hamano2006-07-311-1/+1
| | | | | | Otherwise clicking on that erroneous blob link would produce nonsense. Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: fix use of uninitialized value.Junio C Hamano2006-07-311-3/+5
| | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: an obvious cut and paste error.Junio C Hamano2006-07-311-1/+1
| | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: There can be more than two levels of subdirectoriesJunio C Hamano2006-07-311-16/+8
| | | | | | | | Earlier code to read .git/refs/{tags,heads} hierarchy had a hardcoded up-to-two-level assumption. Lift it by using File::Find. Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: use a hash to lookup the sub for an actionMatthias Lederhofer2006-07-311-56/+25
| | | | | Signed-off-by: Matthias Lederhofer <matled@gmx.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Reordering code and dividing it into categoriesJakub Narebski2006-07-311-776/+840
| | | | | | | | Reorder gitweb code around, divide it into sections (categories) and add some comments. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Remove characters entities entirely when shortening string -- correctionJakub Narebski2006-07-311-1/+1
| | | | | Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: do not quote path for list version of open "-|"Jakub Narebski2006-07-311-1/+1
| | | | | Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Refactor generation of shortlog, tags and heads bodyJakub Narebski2006-07-311-208/+175
| | | | | | | | | | | | | | | | | | | | | | | | | Add git_shortlog_body, git_tags_body and git_heads_body to generate table with shortlog, tags and heads respectively in git_summary and git_shortlog, git_tags, git_heads respectively. Better support for lightweight tags in git_read_refs; currently only lightweight tag pointing to tag object is not resolved fully. Shortlog, tags and heads body tables have proper class now (we could use id instead of class). Add support for showing full comment on mouseover to tags list when comment is shortened, similar to how full title of commit was/is shown on mouseover when title was shortened. Changed layout of tags table to better show lightweight tags. Add showing which branch (head) is current branch (current head), using "current_head" class (we could use id instead). Corrected "</table\n>" and hit_header_div instead of git_header_div. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Ref refactoring - use git_get_referencing for marking tagged/head ↵Jakub Narebski2006-07-301-31/+22
| | | | | | | | | | | | | | | | | | commits Use git_get_referencing to get HTML code for markers showing which refs (tags and heads) point to current commit. It would be much easier to change format of markers in one or two places than thorough the gitweb.cgi file. Added comment about read_info_ref subroutine: for $type == "" (empty argument) it saves only last path part of ref name e.g. from 'refs/heads/jn/gitweb' it would leave only 'gitweb'. Some reordering. Added $ref in one place. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Remove characters entities entirely when shortening stringJakub Narebski2006-07-301-0/+1
| | | | | Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Headers refactoring - use git_header_div for header divsJakub Narebski2006-07-301-60/+40
| | | | | | | | | | | | Add git_header_div subroutine which prints "header" divs, now with class "header" (class "title" is taken, and has set CSS style, changing appereance and maing layout wrong), and use it thorough gitweb.cgi. Change header linking to project summary from empty (&nbsp; as a contents of link) to having $project as contents/name of link. Sometimes a little reordering. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Remove $project from git_get_paging_nav argumentsJakub Narebski2006-07-301-3/+3
| | | | | | | | | Remove $project from arguments passed to git_get_paging_nav subroutine: it did not depend only on arguments, using $my_uri global variable (and now $project global variable). Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Pager refactoring - use git_get_paging_nav for paginationJakub Narebski2006-07-301-36/+32
| | | | | | | | Add git_get_paging_nav subroutine which returns string with pager (paging nav) for shortlog and log actions. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Add "\n" after <br/> in git_page_navJakub Narebski2006-07-301-1/+1
| | | | | Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Show project descriptions with utf-8 characters in project list ↵Jakub Narebski2006-07-301-1/+1
| | | | | | | correctly Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Replace form-feed character by ^LJakub Narebski2006-07-301-0/+1
| | | | | | | | | | | | | | | From 2be5cab10486cba804ccae063e93b146288054fe Mon Sep 17 00:00:00 2001 From: Jakub Narebski <jnareb@gmail.com> Date: Sun, 30 Jul 2006 13:11:56 +0200 Subject: [PATCH] Replace FORM FEED (FF) character (014, 12, 0xc) by it's textual representation '^L'. This character is used for example in GNU GPL 'COPYING' file. With this patch "blob" output for COPYING passes XHTML validation. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Navbar refactoring - use git_page_nav to generate navigation barJakub Narebski2006-07-301-169/+66
| | | | | | | | | | | | Use git_page_nav subroutine to generate navigation bar. Additional navigation (either formats or pager/pagination) is put into variables. Corrects error in git_search where hash parameter was added to "summary" link instead of to "log" link. Might differ from previous version by additional "<br/>" in navigation bar. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Add git_page_nav for later useJakub Narebski2006-07-301-0/+34
| | | | | | | | | | | | | Adds git_page_nav subroutine to factor out the generation of the navigation bar. Based on Sven Verdoolaege code Message-Id: <20050618113121.GA13122@pc117b.liacs.nl> http://marc.theaimsgroup.com/?l=git&m=111909432415478&w=2 I tried for the refactored navbar generate the same result. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Cleanup - chomp @lines in consistent styleJakub Narebski2006-07-301-10/+9
| | | | | | | | | | | Use 'my @lines = map { chomp; $_ } <$fd>;' form to read all lines of git command output into array without trailing newlines. It has advantage over 'chomp (my (@lines) = <$fd>);' in that it does not modify array. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Cleanup - chomp $line in consistent styleJakub Narebski2006-07-301-2/+2
| | | | | Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: More explicit error messages for open "-|"Jakub Narebski2006-07-301-12/+17
| | | | | | | | Use more explicit error messages when failing magical "-|" open, stating at least the name of the git command that failed. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: simplify git_get_hash_by_pathJakub Narebski2006-07-301-23/+9
| | | | | | | | | Simplify git_get_hash_by_path by using git-ls-tree to do path limiting, instead of finding correct ttree and parsing unconstrained git-ls-tree output. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Use list for of open for running git commands, thorougly.Jakub Narebski2006-07-301-24/+27
| | | | | | | | | | | | | | | | | Use list form of open for running git commands and reading their output through pipe, for example open my $fd, "-|", $GIT, "rev-list", "--header", "--parents", $hash instead of open my $fd, "-|", "$GIT rev-list --header --parents $hash" Single letter options use ' instead of " as quotes, according to style used in list form of magic "-|" open. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: whitespace cleanupJakub Narebski2006-07-301-28/+30
| | | | | Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Merge branch 'lt/web'Junio C Hamano2006-07-301-2/+75
|\ | | | | | | | | | | | | | | * lt/web: gitweb.cgi: git_blame2: slight optimization reading the blame lines gitweb.cgi: git_blame2: Revision blocks now have alternating colors gitweb.cgi: git_blame2: Allow back-trekking through commits gitweb.cgi: git_blame2: an alternative simple working git blame
| * gitweb.cgi: git_blame2: slight optimization reading the blame linesLuben Tuikov2006-07-241-14/+5
| | | | | | | | | | | | | | | | Eliminate git_read_blame_line() -- move that code inline and optimize it. Signed-off-by: Luben Tuikov <ltuikov@yahoo.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * gitweb.cgi: git_blame2: Revision blocks now have alternating colorsLuben Tuikov2006-07-241-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A revision block is the largest number of adjacent lines of code originating from the same revision. This patch adds color to git_blame2(), in that no two adjacent revision blocks have the same color. The color alternates between light and dark. As we annotate the code lines, we alternate the color (light, dark) of code lines _per revision_. This makes it easier to see line conglomerations per revision. Signed-off-by: Luben Tuikov <ltuikov@yahoo.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * gitweb.cgi: git_blame2: Allow back-trekking through commitsLuben Tuikov2006-07-241-1/+7
| | | | | | | | | | | | | | | | | | This patch adds the capability of back-trekking through commits from git_blame2() as follows: blame2->commit->blame2->commit->blame2->...->initial commit. Signed-off-by: Luben Tuikov <ltuikov@yahoo.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * gitweb.cgi: git_blame2: an alternative simple working git blameLuben Tuikov2006-07-241-1/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds an alternative simple working git-blame called git_blame2(). Simple, because it displays just three columns: the commit, the line number and the line of code. Alternative, because the original git_blame() is left untouched. Lines of code are printed html escaped, but as-is. git_blame2() uses git-blame as opposed to git-annotate used by git_blame(). Signed-off-by: Luben Tuikov <ltuikov@yahoo.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Merge branch 'lt/web'Junio C Hamano2006-07-281-28/+55
|\ \ | |/
| * gitweb.cgi: Centralize printing of the page pathLuben Tuikov2006-07-241-20/+21
| | | | | | | | | | | | | | | | | | | | Centralize printing of the page path so that if the entity is a blob, we can set the page path to be the link to the HEAD revision of the "raw" blob. Signed-off-by: Luben Tuikov <ltuikov@yahoo.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * gitweb.cgi: Show "raw" head of project link even when $hash is not definedLuben Tuikov2006-07-241-0/+3
| | | | | | | | | | | | | | | | Some callers of git_history() do not set $hash of $file_name. Add code to find it, if it is not defined. Signed-off-by: Luben Tuikov <ltuikov@yahoo.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * gitweb.cgi: Include direct link to "raw" files from "history"Luben Tuikov2006-07-241-6/+29
| | | | | | | | | | | | | | | | | | | | | | | | In "history" view, the "page_path" is now also a URL link to the "raw" format of the file, which will always give you the latest version in the repository. This is helpful for externally linking files, such that the latest version is always referenced and in "raw" format. Signed-off-by: Luben Tuikov <ltuikov@yahoo.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
| * gitweb.cgi: Teach git_history() to read hash from $hash_baseLuben Tuikov2006-07-241-13/+13
| | | | | | | | | | | | | | | | | | Teach git_history() to take its hash argument from the hb parameter, i.e. from $hash_base. Also change all "a=history" actions to pass "hb=" instead of "h=". Signed-off-by: Luben Tuikov <ltuikov@yahoo.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | gitweb: fix two warningsJohannes Schindelin2006-07-261-2/+2
| | | | | | | | | | | | | | These warnings cluttered up my log. Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | gitweb: escape tag commentsDaniel Drake2006-07-251-1/+1
|/ | | | | | | | I have a tag with a comment which includes an & character. Firefox wouldn't display my gitweb summary page due to malformed XML. This solves the problem. Signed-off-by: Daniel Drake <dsd@gentoo.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Make command invocations go through the git wrapperAlp Toker2006-07-121-33/+29
| | | | | | | | | This patch makes invocations of core git commands go through the 'git' binary itself, which improves readability and might help system administrators lock down their CGI environment for security. Signed-off-by: Alp Toker <alp@atoker.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Include a site name in page titlesAlp Toker2006-07-111-2/+6
| | | | | | | | | | This helps users tell one 'git' bookmark apart from the other in their browser and improves the indexing of gitweb sites in Web search engines. The title defaults to the SERVER_NAME environment variable, often given by the webserver. Signed-off-by: Alp Toker <alp@atoker.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Send XHTML as 'application/xhtml+xml' where possibleAlp Toker2006-07-111-2/+12
| | | | | | | | | | | | | | | | | "The 'text/html' media type [RFC2854] is primarily for HTML, not for XHTML. In general, this media type is NOT suitable for XHTML." This patch makes gitweb use content negotiation to conservatively send pages as Content-Type 'application/xhtml+xml' when the user agent explicitly claims to support it. It falls back to 'text/html' even if the user agent appears to implicitly support 'application/xhtml+xml' due to a '*/*' glob, working around an insidious bug in Internet Explorer where sending the correct media type prevents the page from being displayed. Signed-off-by: Alp Toker <alp@atoker.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb.cgi: Teach "a=blob" action to know the blob/file mime typeLuben Tuikov2006-07-101-60/+67
| | | | | | | | | | | | Now action "blob" knows the file type: if the file type is not "text/*" then action "blob" defaults to "blob_plain", i.e. the file is downloaded raw for the browser to interpret. If the file type is "text/*", then "blob" defaults to the current "cat -n"-like output, from which you can click "plain", to get the "blob_plain" output. Signed-off-by: Luben Tuikov <ltuikov@yahoo.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb.cgi: Create $git_temp if it doesn't existLuben Tuikov2006-07-101-0/+3
| | | | | | | | | Unless we'd done diffs, $git_temp doesn't exist and then mime lookups fail. Explicitly create it, if it doesn't exist already. Signed-off-by: Luben Tuikov <ltuikov@yahoo.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Add "raw" output option to blobs in "tree" view formatLuben Tuikov2006-07-091-0/+1
| | | | | | | | | | | | | | | | | | Add a "raw" output option to blobs in "tree" view format, so that the user doesn't have to click on "blob", wait for the (binary) file to be uploaded and shown in "blob" mode, and then click on "plain" to download the (binary) file. This is useful when the file is clearly binary and we don't want the browser to upload and display it in "blob" mode, but we just want to download it. Case in point: pdf files, wlg. Note: the "raw" format is equivalent to the blob->plain view, not blob->head view. I.e. the view has the hash of the file as listed by git-ls-tree, not just "HEAD". Signed-off-by: Luben Tuikov <ltuikov@yahoo.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Declare global variables with "our"Dennis Stosberg2006-07-011-28/+27
| | | | | | | Variables declared with "my" in the file scope cannot be accessed from subroutines with mod_perl. Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Enable tree (directory) history displayLuben Tuikov2006-07-011-0/+1
| | | | | | | | | | | This patch allows history display of whole trees/directories a la "git-rev-list HEAD -- <dir or file>". I find this useful especially when a project lives in its own subdirectory, as opposed to being all of the GIT repository (i.e. when a sub-project is merged into a super-project). Signed-off-by: Luben Tuikov <ltuikov@yahoo.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: optimize per-file history generationJunio C Hamano2006-07-011-7/+3
| | | | | | | | | | | | | The rev-list command that is recent enough can filter commits based on paths they touch, so use it instead of generating the full list and limiting it by passing it with diff-tree --stdin. [jc: The patch originally came from Luben Tuikov but the it was corrupt, but it was short enough to be applied by hand. I added the --full-history to make the output compatible with the original while doing so.] Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: whitespace cleanup around '='Jakub Narebski2006-06-221-4/+4
| | | | | Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>