summaryrefslogtreecommitdiff
path: root/gitweb
Commit message (Collapse)AuthorAgeFilesLines
* gitweb fix validating pg (page) parameterMatthias Lederhofer2006-09-171-1/+1
| | | | | | | | 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-171-13/+21
| | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: export optionsMatthias Lederhofer2006-09-171-3/+20
| | | | | | | | | | | | | $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-171-7/+4
| | | | | | 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-171-8/+8
| | | | | | | | 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-171-7/+27
| | | | | | | | | | | | | | | | | | | 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-161-1/+10
| | | | | | | | | | | 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-161-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | 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-141-0/+25
| | | | | | | | | | | | | | 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-141-22/+19
| | | | | | | | | | | | | | | | | | | 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-141-10/+20
| | | | | | | | | | | 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-101-10/+54
| | | | | | | | | | 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-101-2/+31
| | | | | | | | | 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-041-8/+21
| | | | | | | | | | | | | 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-041-4/+4
| | | | | 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-042-0/+5
| | | | | 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-031-1/+1
| | | | | | | | | | | 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-311-4/+6
| | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Extend parse_difftree_raw_line to save commit infoJakub Narebski2006-08-311-3/+3
| | | | | | | | | | | 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-311-44/+59
| | | | | | | | 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-311-19/+43
| | | | | | | 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-311-1/+1
| | | | | | | | | | 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-311-4/+0
| | | | | | | | | | | | 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-281-2/+10
| | | | | | | | | 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-281-22/+49
| | | | | | | | | | 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-281-0/+1
| | | | | | | | 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-282-0/+18
| | | | | | | | 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>
* gitweb: Do not remove signoff lines in git_print_simplified_logJakub Narebski2006-08-281-1/+0
| | | | | | | | | | Remove '-remove_signoff => 1' option to git_print_log call in the git_print_simplified_log subroutine. This means that in "log" and "commitdiff" views (git_log and git_commitdiff subroutines) signoff lines will be shown. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Make git_print_log generic; git_print_simplified_log uses itJakub Narebski2006-08-281-32/+31
| | | | | | | | | Collapse git_print_log and git_print_simplified_log into one subroutine git_print_log. git_print_simplified_log now simply calls git_print_log with proper options. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Use --git-dir parameter instead of setting $ENV{'GIT_DIR'}Dennis Stosberg2006-08-281-36/+54
| | | | | | | | | | | This makes it possible to run gitweb under mod_perl's Apache::Registry. It needs a fairly new git version, with --git-dir=<path> parameter to git wrapper, i.e. post v1.4.2-rc2-g6acbcb9 version. Signed-off-by: Dennis Stosberg <dennis@stosberg.net> Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Use @diff_opts, default ('M'), as git-diff and git-diff-tree parameteJakub Narebski2006-08-271-9/+24
| | | | | | | | | | | | | | | | | | | Added new global configuration variable @diff_opts, which holds additional options (parameters) to git-diff and git-diff-tree, usually dealing rename/copying detection. Default value is '-M', taken from git_commit subroutine. Description of options and their approximate cost by Junio C Hamano. Changes: * git_commitdiff, git_blobdiff and git_blobdiff_plain now use '-M' instead of '-M', '-C' * git-diff now uses the same options as git-diff-tree * git_comittdiff_plain now uses '-M' instead of '-B' and is now rename-aware * git_rss uses now '-M' instead of () Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Remove git_to_hash functionJakub Narebski2006-08-271-20/+3
| | | | | | | | | Remove git_to_hash function, which was to translate symbolic reference to hash, and it's use in git_blobdiff. We don't try so hard to guess filename if it was not provided. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Remove unused git_get_{preceding,following}_referencesJakub Narebski2006-08-271-51/+0
| | | | | | | | Remove unused (and with errors in implementation) git_get_{preceding,following}_references subroutines. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Fix typo in git_patchset_bodyJakub Narebski2006-08-271-1/+1
| | | | | Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Fix typo in git_difftree_bodyJakub Narebski2006-08-261-1/+1
| | | | | Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: blobs defined by non-textual hash ids can be cachedJakub Narebski2006-08-261-3/+17
| | | | | Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Improve comments about gitweb features configurationJakub Narebski2006-08-261-9/+16
| | | | | Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Remove workaround for git-diff bug fixed in f82cd3cJakub Narebski2006-08-261-2/+1
| | | | | | | | | | Remove workaround in git_blobdiff for error in git-diff (showing reversed diff for diff of blobs), corrected in commit f82cd3c Fix "git diff blob1 blob2" showing the diff in reverse. which is post 1.4.2-rc2 commit. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* Merge branch 'master' into gl/webJunio C Hamano2006-08-261-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: (34 commits) gitweb: git_annotate didn't expect negative numeric timezone git-svn: add the 'dcommit' command git-svn: recommend rebase for syncing against an SVN repo git-svn: establish new connections on commit after fork describe: fix off-by-one error in --abbrev=40 handling git-svn(1): improve asciidoc markup gitview.txt: improve asciidoc markup git(7): put the synopsis in a verse style paragraph gitk(1): expand the manpage to look less like a template git-blame(1): mention options in the synopsis and advertise pickaxe git-ls-remote(1): document --upload-pack git-apply(1): document missing options and improve existing ones update-index -g n is in fact unused, and is later shadowed. use name[len] in switch directly, instead of creating a shadowed variable. builtin-grep.c: remove unused debugging piece. remove ugly shadowing of loop indexes in subloops. missing 'static' keywords git_dir holds pointers to local strings, hence MUST be const. avoid to use error that shadows the function name, use err instead. ...
| * gitweb: git_annotate didn't expect negative numeric timezoneJakub Narebski2006-08-261-1/+1
| | | | | | | | | | Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | gitweb: Remove creating directory for temporary filesJakub Narebski2006-08-251-6/+0
| | | | | | | | | | | | | | | | Remove $git_temp variable which held location for temporary files needed by git_diff_print, and removed creating $git_temp directory. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | gitweb: Remove git_diff_print subroutineJakub Narebski2006-08-251-71/+0
| | | | | | | | | | | | | | | | | | Remove git_diff_print subroutine, used to print diff in previous versions of "diff" actions, namely git_commitdiff, git_commitdiff_plain, git_blobdiff, git_blobdiff_plain. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | gitweb: git_blobdiff_plain is git_blobdiff('plain')Jakub Narebski2006-08-251-25/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git_blobdiff and git_blobdiff_plain are now collapsed into one subroutine git_blobdiff, with format (currently 'html' which is default format corresponding to git_blobdiff, and 'plain' corresponding to git_blobdiff_plain) specified in argument. blobdiff_plain format is now generated either by git-diff-tree or by git-diff. Added X-Git-Url: header. From-file and to-file name in header are corrected. Note that for now commitdiff_plain does not detect renames and copying, while blobdiff_plain does. While at it, set expires to "+1d" for non-textual hash ids. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | gitweb: Use git-diff-tree or git-diff patch output for blobdiffJakub Narebski2006-08-251-17/+132
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is second part of removing gitweb dependency on external diff (used in git_diff_print). Get rid of git_diff_print invocation in git_blobdiff, and use either git-diff-tree (when both hash_base and hash_parent_base are provided) patch format or git-diff patch format (when only hash and hash_parent are provided) for output. Supported URI schemes, and output formats: * New URI scheme: both hash_base and hash_parent_base (trees-ish containing blobs versions we want to compare) are provided. Also either filename is provided, or hash (of blob) is provided (we try to find filename then). For this scheme we have copying and renames detection, mode changes, file types etc., and information extended diff header is correct. * Old URI scheme: hash_parent_base is not provided, we use hash and hash_parent to directly compare blobs using git-diff. If no filename is given, blobs hashes are used in place of filenames. This scheme has always "blob" as file type, it cannot detect mode changes, and we rely on CGI parameters to provide name of the file. Added git_to_hash subroutine, which transforms symbolic name or list of symbolic name to hash or list of hashes using git-rev-parse. To have "blob" instead of "unknown" (or "file" regardless of the type) in "gitweb diff header" for legacy scheme, file_type function now returns its argument if it is not octal string. Added support for fake "2" status code in git_patchset_body. Such code is generated by git_blobdiff in legacy scheme case. ATTENTION: The order of arguments (operands) to git-diff is reversed (sic!) to have correct diff in the legacy (no hash_parent_base) case. $hash_parent, $hash ordering is commented out, as it gives reversed patch (at least for git version 1.4.1.1) as compared to output in new scheme and output of older gitweb version. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | gitweb: Change here-doc back for style consistency in git_blobdiffJakub Narebski2006-08-251-4/+2
| | | | | | | | | | Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | gitweb: Always display link to blobdiff_plain in git_blobdiffJakub Narebski2006-08-251-7/+7
| | | | | | | | | | Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | gitweb: Add invisible hyperlink to from-file/to-file diff headerJakub Narebski2006-08-252-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | Change replacing hashes as from-file/to-file with filenames from difftree to adding invisible (except underlining on hover/mouseover) hyperlink to from-file/to-file blob. /dev/null as from-file or to-file is not changed (is not hyperlinked). This makes two-file from-file/to-file unified diff header parsing in git_patchset_body more generic, and not only for legacy blobdiffs. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | gitweb: Parse two-line from-file/to-file diff header in git_patchset_bodyJakub Narebski2006-08-252-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Parse two-line from-file/to-file unified diff header in git_patchset_body directly, instead of leaving pretty-printing to format_diff_line function. Hashes as from-file/to-file are replaced by proper from-file and to-file names (from $diffinfo); in the future we can put hyperlinks there. This makes possible to do blobdiff with only blobs hashes. The lines in two-line unified diff header have now class "from_file" and "to_file"; the style is chosen to match previous output (classes "rem" and "add" because of '-' and '+' as first character of patch line). Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | gitweb: Allow for pre-parsed difftree info in git_patchset_bodyJakub Narebski2006-08-251-25/+30
| | | | | | | | | | | | | | | | Preparation for converting git_blobdiff and git_blobdiff_plain to use git-diff-tree patch format to generate patches. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | gitweb: Add support for hash_parent_base parameter for blobdiffsJakub Narebski2006-08-251-10/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for hash_parent_base in input validation part and in href() function. Add proper hash_parent_base to all calls to blobdiff and blobdiff_plain action URLs. Use hash_parent_base as hash_base for blobs of hash_parent. To be used in future rewrite of git_blobdiff and git_blobdiff_plain. While at it, move project before action in ordering CGI parameters in href(). Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>