aboutsummaryrefslogtreecommitdiff
path: root/gitweb
Commit message (Collapse)AuthorAge
* gitweb: Decode long title for link tooltipsYasushi SHOJI2006-09-27
| | | | | | | | | | | | This is a simple one liner to decode long title string in perl's internal form to utf-8 for link tooltips. This is not crucial if the commit message is all in ASCII, however, if you decide to use other encoding, such as UTF-8, tooltips ain't readable any more. Signed-off-by: Yasushi SHOJI <yashi@atmark-techno.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: fix over-eager application of esc_html().Petr Baudis2006-09-24
| | | | | | | | | Contents of %diffinfo hash should be quoted upon output but kept unquoted internally. Later users of this hash expect filenames to be filenames, not HTML gibberish. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Consolidate escaping/validation of query stringPetr Baudis2006-09-23
| | | | | | | | | | | | | | | | | | Consider: http://repo.or.cz/?p=glibc-cvs.git;a=tree;h=2609cb0411389325f4ee2854cc7159756eb0671e;hb=2609cb0411389325f4ee2854cc7159756eb0671e (click on the funny =__ify file) We ought to handle anything in filenames and I actually see no reason why we don't, modulo very little missing escaping that this patch hopefully also fixes. I have also made esc_param() escape [?=&;]. Not escaping [&;] was downright buggy and [?=] just feels better escaped. ;-) YMMV. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Fix snapshot link in tree viewPetr Baudis2006-09-22
| | | | | | | It would just give HEAD snapshot instead of one of the particular tree. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Fix @git_base_url_list usagePetr Baudis2006-09-22
| | | | | | | As it is now, that array was never used because the customurl accessor was broken and ''unless @url_list'' never happenned. Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Fix tree link associated with each commit log entry.Petr Baudis2006-09-22
| | | | | | | The link forgot to have hb parameter and the resulting tree view failed to show the navbar for that commit. Signed-off-by: Junio C Hamano <junkio@cox.net>
* Make path in tree view look nicerPetr Baudis2006-09-22
| | | | | | | | | | Based on talk on the IRC with Junio some evenings ago, I've updated the path showing in tree view to look better and sent updated patches privately, but it seems the old version ended up being used, so here's the new one again. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Relabel "head" as "HEAD"Petr Baudis2006-09-21
| | | | | | | | "head" is a reference in refs/heads/, while those labels mean HEAD, the latest revision of the default branch. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Rename "plain" labels to "raw"Petr Baudis2006-09-21
| | | | | | | | I don't have much preference either way and as far as I'm concerned, it may go the other way as well. Consistency is what is important. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Link to associated tree from a particular log item in full log viewPetr Baudis2006-09-21
| | | | | Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Link to latest tree from the head line in heads listPetr Baudis2006-09-21
| | | | | Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Link to tree instead of snapshot in shortlogPetr Baudis2006-09-21
| | | | | Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: More per-view navigation bar linksPetr Baudis2006-09-21
| | | | | | | | | | | Navigation bars in various views were empty or missed important items that should have been there, e.g. getting a snapshot in tree view or log of ancestry in commit view... This feeble patch attempts to consolidate that. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Link (HEAD) tree for each project from projects listPetr Baudis2006-09-21
| | | | | | | | | | | | Current projects list is oriented on easily getting "what's new" information. But when already using gitweb as an interface to something, I personally find myself to _much_ more frequently wanting to rather see "what's in" (or "what's new in") and it's quite annoying to have to go through the summary page (which is also rather expensive to generate) just to get there. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Make git_get_hash_by_path check type if providedJakub Narebski2006-09-21
| | | | | Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Fix showing of path in tree viewPetr Baudis2006-09-21
| | | | | | | | | | | | This patch fixes two things - links to all path elements except the last one were broken since gitweb does not like the trailing slash in them, and the root tree was not reachable from the subdirectory view. To compensate for the one more slash in the front, the trailing slash is not there anymore. ;-) I don't care if it stays there though. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: fix display of trees via PATH_INFO.Martin Waitz2006-09-21
| | | | | | | | When adding a / to the URL, git should display the corresponding tree object, but it has to remove the / first. Signed-off-by: Martin Waitz <tali@admingilde.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Fix thinko in git_tags and git_headsJakub Narebski2006-09-20
| | | | | | | | | | | git_get_refs_list always return reference to list (and reference to hash which we ignore), so $taglist (in git_tags) and $headlist (in git_heads) are always defined, but @$taglist / @$headlist might be empty. Replaced incorrect "if (defined @$taglist)" with "if (@$taglist)" in git_tags and respectively in git_heads. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Make git_get_refs_list do work of git_get_referencesJakub Narebski2006-09-20
| | | | | | | | | | | | | | Make git_get_refs_list do also work of git_get_references, to avoid calling git-peek-remote twice. Change meaning of git_get_refs_list meaning: it is now type, and not a full path, e.g. we now use git_get_refs_list("heads") instead of former git_get_refs_list("refs/heads"). Modify git_summary to use only one call to git_get_refs_list instead of one call to git_get_references and two to git_get_refs_list. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Always use git-peek-remote in git_get_referencesJakub Narebski2006-09-20
| | | | | | | | | | | | | Instead of trying to read info/refs file, which might not be present (we did fallback to git-ls-remote), always use git-peek-remote in git_get_references. It is preparation for git_get_refs_info to also return references info. We should not use info/refs for git_get_refs_info as the repository is not served for http-fetch clients. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Require project for almost all actionsJakub Narebski2006-09-20
| | | | | | | | Require that project (repository) is given for all actions except project_list, project_index and opml. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Even more support for PATH_INFO based URLsJakub Narebski2006-09-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now the following types of path based URLs are supported: * project overview (summary) page of project * project/branch shortlog of branch * project/branch:file file in branch, blob_plain view * project/branch:dir/ directory listing of dir in branch, tree view The following shortcuts works (see explanation below): * project/branch: directory listing of branch, main tree view * project/:file file in HEAD (raw) * project/:dir/ directory listing of dir in HEAD * project/: directory listing of project's HEAD We use ':' as separator between branch (ref) name and file name (pathname) because valid branch (ref) name cannot have ':' inside. This limit applies to branch name only. This allow for hierarchical branches e.g. topic branch 'topic/subtopic', separate remotes tracking branches e.g. 'refs/remotes/origin/HEAD', and discriminate between head (branch) and tag with the same name. Empty branch should be interpreted as HEAD. If pathname (the part after ':') ends with '/', we assume that pathname is name of directory, and we want to show contents of said directory using "tree" view. If pathname is empty, it is equivalent to '/' (top directory). If pathname (the part after ':') does not end with '/', we assume that pathname is name of file, and we show contents of said file using "blob_plain" view. Pathname is stripped of leading '/', so we can use ':/' to separate branch from pathname. The rationale behind support for PATH_INFO based URLs was to support project web pages for small projects: just create an html branch and then use an URL like http://nowhere.com/gitweb.cgi/project.git/html:/index.html The ':/' syntax allow for working links between .html files served in such way, e.g. <a href="main.html"> link inside "index.html" would get http://nowhere.com/gitweb.cgi/project.git/html:/main.html. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Fix mimetype_guess_file for files with multiple extensionsJakub Narebski2006-09-20
| | | | | | | | | | | Fix getting correct mimetype for "blob_plain" view for files which have multiple extensions, e.g. foo.1.html; now only the last extension is used to find mimetype. Noticed by Martin Waitz. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb fix validating pg (page) parameterMatthias Lederhofer2006-09-17
| | | | | | | | Currently it is possible to give any string ending with a number as page. -1 for example is quite bad (error log shows probably 100 warnings). Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: fix warnings in PATH_INFO code and add export_ok/strict_exportMatthias Lederhofer2006-09-17
| | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: export optionsMatthias Lederhofer2006-09-17
| | | | | | | | | | | | | $export_ok: If this variable evaluates to true it is checked if a file with this name exists in the repository. If it does not exist the repository cannot be viewed from gitweb. (Similar to git-daemon-export-ok for git-daemon). $strict_export: If this variable evaluates to true only repositories listed on the project-list-page of gitweb can be accessed. Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: do not use 'No such directory' error messageMatthias Lederhofer2006-09-17
| | | | | | undef $project; to prevent a file named description to be read. Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: fix uninitialized variable warning.Martin Waitz2006-09-17
| | | | | | | | Perl spit out a varning when "blob" or "blob_plain" actions were used without a $hash parameter. Signed-off-by: Martin Waitz <tali@admingilde.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: more support for PATH_INFO based URLsMartin Waitz2006-09-17
| | | | | | | | | | | | | | | | | | | Now three types of path based URLs are supported: gitweb.cgi/project.git gitweb.cgi/project.git/branch gitweb.cgi/project.git/branch/filename The first one (show project summary) was already supported for a long time now. The other two are new: they show the shortlog of a branch or the plain file contents of some file contained in the repository. This is especially useful to support project web pages for small projects: just create an html branch and then use an URL like gitweb.cgi/project.git/html/index.html. Signed-off-by: Martin Waitz <tali@admingilde.org> Acked-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Add link to "project_index" view to "project_list" pageJakub Narebski2006-09-16
| | | | | | | | | | | Add link to "project_index" view as [TXT] beside link to "opml" view, (which is marked by [OPML]) to "project_list" page. While at it add alternate links for "opml" and "project_list" to HTML header for "project_list" view. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Allow for href() to be used for links without project paramJakub Narebski2006-09-16
| | | | | | | | | | | | | | | | | | | | | | | | Make it possible to use href() subroutine to generate link with query string which does not include project ('p') parameter. href() used to add project=$project to its parameters, if it was not set (to be more exact if $params{'project'} was false). Now you can pass "project => undef" if you don't want for href() to add project parameter to query string in the generated link. Links to "project_list", "project_index" and "opml" (all related to list of all projects/all git repositories) doesn't need project parameter. Moreover "project_list" is default view (action) if project ('p') parameter is not set, just like "summary" is default view (action) if project is set; project list served as a kind of "home" page for gitweb instalation, and links to "project_list" view were done without specyfying it as an action. Convert remaining links (except $home_link and anchor links) to use href(); this required adding 'order => "o"' to @mapping in href(). This finishes consolidation of URL generation. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Add git_project_index for generating index.auxJakub Narebski2006-09-14
| | | | | | | | | | | | | | Add git_project_index, which generates index.aux file that can be used as a source of projects list, instead of generating projects list from a directory. Using file as a source of projects list allows for some projects to be not present in gitweb main (project_list) page, and/or correct project owner info. And is probably faster. Additionally it can be used to get the list of all available repositories for scripts (in easily parseable form). Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Do not parse refs by hand, use git-peek-remote insteadJakub Narebski2006-09-14
| | | | | | | | | | | | | | | | | | | This is in response to Linus's work on packed refs. Additionally it makes gitweb work with symrefs, too. Do not parse refs by hand, using File::Find and reading individual heads to get hash of reference, but use git-peek-remote output instead. Assume that the hash for deref (with ^{}) always follows hash for ref, and that we have derefs only for tag objects; this removes call to git_get_type (and git-cat-file -t invocation) for tags, which speeds "summary" and "tags" views generation, but might slow generation of "heads" view a bit. For now, we do not save and use the deref hash. Remove git_get_hash_by_ref while at it, as git_get_refs_list was the only place it was used. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Use File::Find::find in git_get_projects_listJakub Narebski2006-09-14
| | | | | | | | | | | Earlier code to get list of projects when $projects_list is a directory (e.g. when it is equal to $projectroot) had a hardcoded flat (one level) list of directories. Allow for projects to be in subdirectories also for $projects_list being a directory by using File::Find. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Paginate history outputJakub Narebski2006-09-10
| | | | | | | | | | git_history output is now divided into pages, like git_shortlog, git_tags and git_heads output. As whole git-rev-list output is now read into array before writing anything, it allows for better signaling of errors. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Make pickaxe search a featureJakub Narebski2006-09-10
| | | | | | | | | As pickaxe search (selected using undocumented 'pickaxe:' operator in search query) is resource consuming, allow to turn it on/off using feature meachanism. Turned on by default, for historical reasons. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Divide page path into directories -- path's "breadcrumbs"Jakub Narebski2006-09-04
| | | | | | | | | | | | | Divide page path into directories, so that each part of path links to the "tree" view of the $hash_base (or HEAD, if $hash_base is not set) version of the directory. If the entity is blob, final part (basename) links to $hash_base or HEAD revision of the "raw" blob ("blob_plain" view). If the entity is tree, link to the "tree" view. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Correct typo: '==' instead of 'eq' in git_difftree_bodyJakub Narebski2006-09-04
| | | | | Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Add GIT favicon, assuming image/png typeJakub Narebski2006-09-04
| | | | | Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Change the name of diff to parent link in "commit" view to "diffJakub Narebski2006-09-03
| | | | | | | | | | | Change the name of diff to parent (current commit to one of parents) link in "commit" view (git_commit subroutine) from "commitdiff" to "diff". Let's leave "commitdiff" for equivalent of git-show, or git-diff-tree with one revision, i.e. diff for a given commit to its parent (parents). Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Fix git_blameAneesh Kumar K.V2006-08-31
| | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Extend parse_difftree_raw_line to save commit infoJakub Narebski2006-08-31
| | | | | | | | | | | Extend parse_difftree_raw_line to save commit info from when git-diff-tree is given only one <tree-ish>, for example when fed from git-rev-list using --stdin option. git-diff-tree outputs a line with the commit ID when applicable. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Separate printing of git_tree row into git_print_tree_entryJakub Narebski2006-08-31
| | | | | | | | This is preparation for "tree blame" (similar to what ViewVC shows) output, i.e. for each entry give commit where it was changed. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Move git-ls-tree output parsing to parse_ls_tree_lineJakub Narebski2006-08-31
| | | | | | | Add new subroutine parse_ls_tree_line and use it in git_tree. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* use do() instead of require() to include configurationDennis Stosberg2006-08-31
| | | | | | | | | | When run under mod_perl, require() will read and execute the configuration file on the first invocation only. On every subsequent invocation, all configuration variables will be reset to their default values. do() reads and executes the configuration file unconditionally. Signed-off-by: Dennis Stosberg <dennis@stosberg.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Remove forgotten call to git_to_hashDennis Stosberg2006-08-31
| | | | | | | | | | | | On Aug 27th, Jakub Narebski sent a patch which removed the git_to_hash() function and this call to it. The patch did not apply cleanly and had to be applied manually. Removing the last chunk has obviously been forgotten. See: commit 0aea33762b1262d11fb43eda9f3fc152b5622cca and message <200608272345.26722.jnareb@gmail.com> Signed-off-by: Dennis Stosberg <dennis@stosberg.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Add local time and timezone to git_print_authorshipJakub Narebski2006-08-28
| | | | | | | | | Add local time (hours and minutes) and local timezone to the output of git_print_authorship command, used by git_commitdiff. The code was taken from git_commit subroutine. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Add diff tree, with links to patches, to commitdiff viewJakub Narebski2006-08-28
| | | | | | | | | | Added/uncommented git_difftree_body invocation in git_commitdiff. Added anchors (via 'id' attribute) to patches in patchset. git_difftree_body is modified to link to patch anchor when called from git_commitdiff, instead of link to blobdiff. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: git_print_log: signoff line is non-empty lineJakub Narebski2006-08-28
| | | | | | | | This correct minor error in git_print_log that didn't add final empty line when requested, if commit log ended with signoff. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Add author information to commitdiff viewJakub Narebski2006-08-28
| | | | | | | | Add subroutine git_print_authorship to print author and date of commit, div.author_date style to CSS, and use them in git_commitdiff. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>