summaryrefslogtreecommitdiff
path: root/gitweb
AgeCommit message (Collapse)Author
2007-03-07gitweb: Don't escape attributes in CGI.pm HTML methodsJakub Narebski
There is no need to escape HTML tag's attributes in CGI.pm HTML methods (like CGI::a()), because CGI.pm does attribute escaping automatically. $cgi->a({ ... -attribute => atribute_value }, tag_contents) is translated to <a ... attribute="attribute_value">tag_contents</a> The rules for escaping attribute values (which are string contents) are different. For example you have to take care about escaping embedded '"' and "'" characters; CGI::a() does that for us automatically. CGI::a() does not HTML escape tag_contents; we would need to write <a href="URL">some <b>bold</b> text</a> for example. So we use esc_html (or esc_path) to escape tag_contents as needed. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-06gitweb: Change to use explicitly function call cgi->escapHTML()Li Yang
Change to use explicitly function call cgi->escapHTML(). This fix the problem on some systems that escapeHTML() is not functioning, as default CGI is not setting 'escape' parameter. Signed-off-by: Li Yang <leoli@freescale.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-06gitweb: fix mismatched parenthesisJunio C Hamano
An earlier commit 04179418 broke gitweb. Badly. Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-05gitweb: Convert project name to UTF-8Yasushi SHOJI
If the repository directory name is in non-ascii, $project needs to be converted from perl internal to utf-8 because it will be used as title, page path, and snapshot filename. use to_utf8() to do the conversion. Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-04Assorted typo fixesPavel Roskin
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-29[PATCH] Rename git-repo-config to git-config.Tom Prince
Signed-off-by: Tom Prince <tom.prince@ualberta.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-10gitweb: Fix git_patchset_body not closing <div class="patch">Jakub Narebski
Fix case when git_patchset_body didn't close <div class="patch">, for patchsets with last patch empty. This patch also removes some commented out code in git_patchset_body. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Acked-by: Luben Tuikov <ltuikov@yahoo.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-08gitweb: Remove superfluous "|" in "commit" viewJakub Narebski
Remove superfluous trailing "|" separator from difftree part of "commit" view for new files (created in given commit). Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-07gitweb: Fix split patches output (e.g. file to symlink)Jakub Narebski
Do not replace /dev/null in two-line from-file/to-file diff header for split patches ("split" patch mean more than one patch per one diff-tree raw line) by a/file or b/file link. Split patches differ from pair of deletion/creation patch in git diff header: both a/file and b/file are hyperlinks, in all patches in a split. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-07Revert "gitweb: There can be empty patches (in git_patchset_body)"Jakub Narebski
This reverts commit 1ebb948f656c03a5bdaab4de1a113b9ffcb98bea, as that patch quieted warning but was not proper solution. The previous commit was. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-07gitweb: Fix errors in git_patchset_body for empty patchesJakub Narebski
We now do not skip over empty patches in git_patchset_body (where empty means that they consist only of git diff header, and of extended diff header, for example "pure rename" patch). This means that after extended diff header there can be next patch (i.e. /^diff /) or end of patchset, and not necessary patch body (i.e. /^--- /). Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-07gitweb: Fix error in "rename to"/"copy to" git diff header outputJakub Narebski
Fix error in git_patchset_body subroutine, which caused "rename to"/"copy to" line in extended diff header to be displayed incorrectly. While at it, fix align. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-07gitweb: Fix error in git_patchest_body for file creation/deletion patchJakub Narebski
$from_id, $to_id variables should be local per PATCH. Fix error in git_patchset_body for file creation (deletion) patches, where instead of /dev/null as from-file (to-file) diff header line, it had link to previous file with current file name. This error occured only if there was another patch before file creation (deletion) patch. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-05Blame "linenr" link jumps to previous state at "orig_lineno"Luben Tuikov
Blame currently displays the commit id which introduced a block of one or more lines, the line numbers wrt the current listing of the file and the file's line contents. The commit id displayed is hyperlinked to the commit. Currently the linenr links are hyperlinked to the same commit id displayed to the left, which is _no_ different than the block of lines displayed, since it is the _same commit_ that is hyperlinked. And thus clicking on it leads to the same state of the file for that chunk of lines. I.e. data mining is not currently possible with gitweb given a chunk of lines introduced by a commit. This patch makes such data mining possible. The line numbers are now hyperlinked to the parent of the commit id of the block of lines. Furthermore they are linked to the line where that block was introduced. Thus clicking on a linenr link will show you the file's line(s) state prior to the commit id you were viewing. So clicking continually on a linenr link shows you how this line and its line number changed over time, leading to the initial commit where it was first introduced. Signed-off-by: Luben Tuikov <ltuikov@yahoo.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-05gitweb: Fix "Use of uninitialized value" warning in git_tags_bodyJakub Narebski
Fix "Use of uninitialized value" warning in git_tags_body generated for lightweight tags of tree and blob object; those don't have age ($tag{'age'}) defined. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-03gitweb: Fix shortlog only showing HEAD revision.Robert Fitzsimons
My change in 190d7fdcf325bb444fa806f09ebbb403a4ae4ee6 had a small bug found by Michael Krufky which caused the passed in hash value to be ignored, so shortlog would only show the HEAD revision. Signed-off-by: Robert Fitzsimons <robfitz@273k.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-03gitweb: There can be empty patches (in git_patchset_body)Jakub Narebski
We now do not skip over empty patches in git_patchset_body (where empty means that they consist only of git diff header, and of extended diff header), so uncomment branch of code dealing with empty patches (patches which do not have even two-line from/to header) Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-03gitweb: Fix bug in git_difftree_body (was '!=' instead of 'ne')Jakub Narebski
Fix bug in git_difftree_body subroutine; it was used '!=' comparison operator for strings (file type) instead of correct 'ne'. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-01-03gitweb: Fix error in git_project_index subroutineJakub Narebski
Instead of "$projectroot/$pr->{'path'}" to get the path to project GIT_DIR, it was used "$projectroot/$project" which is valid only for actions where project parameter is set, and 'project_index' is not one of them. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-28gitweb: Precompile CGI routines for mod_perlJakub Narebski
Following advice from CGI(3pm) man page, precompile all CGI routines for mod_perl, in the BEGIN block. If you want to compile without importing use the compile() method instead: use CGI(); CGI->compile(); This is particularly useful in a mod_perl environment, in which you might want to precompile all CGI routines in a startup script, and then import the functions individually in each mod_perl script. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-28gitweb: Add mod_perl version string to "generator" meta headerJakub Narebski
Add mod_perl version string (the value of $ENV{'MOD_PERL'} if it is set) to "generator" meta header. The purpose of this is to identify version of gitweb, now that codepath may differ for gitweb run as CGI script, run under mod_perl 1.0 and run under mod_perl 2.0. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-27gitweb: Re-enable rev-list --parents for parse_commit.Robert Fitzsimons
Re-enable rev-list --parents for parse_commit which was removed in (208b2dff95bb48682c351099023a1cbb0e1edf26). rev-list --parents is not just used to return the parent headers in the commit object, it includes any grafts which are vaild for the commit. Signed-off-by: Robert Fitzsimons <robfitz@273k.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-25gitweb: Use rev-list --skip option.Robert Fitzsimons
Signed-off-by: Robert Fitzsimons <robfitz@273k.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-25gitweb: Change history action to use parse_commits.Robert Fitzsimons
Also added missing accesskey. Signed-off-by: Robert Fitzsimons <robfitz@273k.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-25gitweb: Change atom, rss actions to use parse_commits.Robert Fitzsimons
Signed-off-by: Robert Fitzsimons <robfitz@273k.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-25gitweb: Change header search action to use parse_commits.Robert Fitzsimons
Signed-off-by: Robert Fitzsimons <robfitz@273k.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-25gitweb: Change log action to use parse_commits.Robert Fitzsimons
Also add missing next link to bottom of page. Signed-off-by: Robert Fitzsimons <robfitz@273k.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-25gitweb: Change summary, shortlog actions to use parse_commits.Robert Fitzsimons
Also added missing accesskey. Signed-off-by: Robert Fitzsimons <robfitz@273k.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-25gitweb: We do longer need the --parents flag in rev-list.Robert Fitzsimons
We only want to know the direct parents of a given commit object, these parents are available in the --header output of rev-list. If --parents is supplied with --full-history the output includes merge commits that aren't relevant. Signed-off-by: Robert Fitzsimons <robfitz@273k.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-25gitweb: Add parse_commits, used to bulk load commit objects.Robert Fitzsimons
Add a new method parse_commits which is able to parse multiple commit objects at once. Reworked parse_commit to share the commit object parsing logic. Signed-off-by: Robert Fitzsimons <robfitz@273k.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-23gitweb: Paginate commit/author/committer search outputRobert Fitzsimons
Paginate commit/author/committer search output to only show 100 commits at a time, added appropriate nav links. Signed-off-by: Robert Fitzsimons <robfitz@273k.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-23gitweb: Allow search to be disabled from the config file.Robert Fitzsimons
Signed-off-by: Robert Fitzsimons <robfitz@273k.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-23gitweb: Require a minimum of two character for the search text.Robert Fitzsimons
Signed-off-by: Robert Fitzsimons <robfitz@273k.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-23gitweb: Use rev-list pattern search options.Robert Fitzsimons
Use rev-list pattern search options instead of hand coded perl. Signed-off-by: Robert Fitzsimons <robfitz@273k.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-23gitweb: optimize git_summary.Robert Fitzsimons
We don't need to call git_get_head_hash at all just pass in "HEAD" and use the return id field. Signed-off-by: Robert Fitzsimons <robfitz@273k.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-23gitweb: optimize git_shortlog_body.Robert Fitzsimons
Don't call gitweb_have_snapshot from within the loop. Signed-off-by: Robert Fitzsimons <robfitz@273k.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-23gitweb: optimize git_get_last_activity.Robert Fitzsimons
Only return one line of output and we don't need the refname value. Signed-off-by: Robert Fitzsimons <robfitz@273k.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-23gitweb: Add missing show '...' links change.Robert Fitzsimons
Part of the patch for "gitweb: Show '...' links in "summary" view only if there are more items" (313ce8cee665447e4476d7e8985b270346a8e5a1) is missing. Add it back in. Signed-off-by: Robert Fitzsimons <robfitz@273k.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-20gitweb: Show '...' links in "summary" view only if there are more itemsRobert Fitzsimons
Show "..." links in "summary" view to shortlog, heads (if there are any), and tags (if there are any) only if there are more items to show than shown already. This means that "..." link is shown below shortened shortlog if there are more than 16 commits, "..." link below shortened heads list if there are more than 16 heads refs (16 branches), "..." link below shortened tags list if there are more than 16 tags. Modified patch from Jakub to to apply cleanly to master, also preform the same "..." link logic to the forks list. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Robert Fitzsimons <robfitz@273k.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-16gitweb: Add "next" link to commit viewJakub Narebski
Add a kind of "next" view in the bottom part of navigation bar for "commit" view, similar to what was added for "commitdiff" view in commit 151602df00b8e5c5b4a8193f59a94b85f9b5aebc 'gitweb: Add "next" link to commitdiff view' For "commit" view for single parent commit: (parent: _commit_) For "commit" view for merge (multi-parent) commit: (merge: _commit_ _commit_ ...) For "commit" view for root (parentless) commit (initial) where _link_ denotes hyperlink. SHA1 of commit is shortened to 7 characters on display. While at it, remove leftovers from commit cae1862a by Petr Baudis: 'gitweb: More per-view navigation bar links' namely the "blame" link if there exist $file_name and commit has a parent; it was added in git_commit probably by mistake. The rest of what mentioned commit added for git_commit was removed in commit 6e0e92fda893311ff5af91836e5007bf6bbd4a21 by Luben Tuikov: 'gitweb: Do not print "log" and "shortlog" redundantly in commit view' (which should have probably removed also this "blame" link removed now). Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-16gitweb: Add title attribute to ref marker with full ref nameJakub Narebski
Add title attribute, which will be shown as popup on mouseover in graphical web browsers, with full name of ref, including part (type) removed from the name of ref itself. This is useful to see that this strange ref is StGIT ref, or it is remote branch, or it is lightweigh tag (with branch-like name). Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-16gitweb: Do not show difftree for merges in "commit" viewJakub Narebski
Do not show difftree against first parent for merges (commits with more than one parent) in "commit" view, because it usually is misleading. git-show and git-whatchanged doesn't show diff for merges either. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-12gitweb: SHA-1 in commit log message links to "object" viewJakub Narebski
Instead of checking if explicit SHA-1 in commit log message is sha1 of commit and making link to "commit" view, make [fragment of] explicit SHA-1 in commit log message link to "object" view. While at it allow to hyperlink also shortened SHA-1, from 8 characters up to full SHA-1, instead of requiring full 40 characters of SHA-1. This makes the following changes: * SHA-1 of objects which no longer exists, for example in commit cherry-picked from no longer existing temporary branch, or revert of commit in rebased branch, are no longer marked as such by not being made into hyperlink (and not having default hyperlink view: being underlined among others). On the other hand it makes gitweb to not write error messages when object is not found to web serwer log; it also moves cost of getting type and SHA-1 validation to when link is clicked, and not only viewed. * SHA-1 of other objects: blobs, trees, tags are also hyperlinked and lead to appropriate view (although in the case of tags it is more natural to just use tag name). * You can put shortened SHA-1 of commit in the commit message, and it would be hyperlinked; it would be checked on clicking if abbrev is unique. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-12gitweb: Hyperlink target of symbolic link in "tree" view (if possible)Jakub Narebski
Make symbolic link target in "tree" view into hyperlink to generic "object" view (as we don't know if the link target is file (blob) or directory (tree), and if it exist at all). Target of link is made into hyperlink when: * hash_base is provided (otherwise we cannot find hash of link target) * link is relative * in no place link goes out of root tree (top dir) Full path of symlink target from the root dir is provided in the title attribute of hyperlink. Currently symbolic link name uses ordinary file style (hidden hyperlink), while the hyperlink to symlink target uses default hyperlink style, so it is underlined while link target which is not made into hyperlink is not underlined. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-12gitweb: Add generic git_object subroutine to display object of any typeJakub Narebski
Add generic "object" view implemented in git_object subroutine, which is used to display object of any type; to be more exact it redirects to the view of correct type: "blob", "tree", "commit" or "tag". To identify object you have to provide either hash (identifier of an object), or (in the case of tree and blob objects) hash of commit object (hash_base) and path (file_name). Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-12gitweb: Show target of symbolic link in "tree" viewJakub Narebski
In "tree" view (git_print_tree_entry subroutine), for entries which are symbolic links, add " -> link_target" after file name (a la "ls -l"). Link target is _not_ hyperlinked. While at it, correct whitespaces (tabs are for aling, spaces are for indent) in modified git_print_tree_entry subroutine. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-12gitweb: Don't use Content-Encoding: header in git_snapshotJakub Narebski
Do not use Content-Encoding: HTTP header in git_snapshot, using instead type according to the snapshot type (compression type). Some of web browser take Content-Encoding: to be _transparent_ also for downloading, and store decompressed file (with incorrect compression suffix) on download. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-08Fix documentation copy&paste typoUwe Zeisberger
This was introduced in 45a3b12cfd3eaa05bbb0954790d5be5b8240a7b5 Signed-off-by: Uwe Kleine-K,AC6(Bnig <zeisberg@informatik.uni-freiburg.de> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-06gitweb: Allow PNG, GIF, JPEG images to be displayed in "blob" viewJakub Narebski
Allow images in one of web formats (PNG, GIF, JPEG) - actually files with mimetype of image/png, image/git, image/jpeg - to be displayed in "blob" view using <img /> element, instead of using "blob_plain" view for them, like for all other files except also text/* mimetype files. This makes possible to easily go to file history, to HEAD version of the file, to appropriate commit etc; all of those are not available in "blob_plain" (raw) view. Only text files can have "blame" view link in the formats part of navbar. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-12-04gitweb: Fix Atom feed <logo>: it is $logo, not $logo_urlJakub Narebski
Fix contents of Atom feed <logo> element; it should be URL of $logo, not URL pointed by logo link. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>