aboutsummaryrefslogtreecommitdiff
path: root/gitweb
Commit message (Collapse)AuthorAge
* gitweb: Show '...' links in "summary" view only if there are more itemsRobert Fitzsimons2006-12-19
| | | | | | | | | | | | | | | | | | 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>
* gitweb: Add "next" link to commit viewJakub Narebski2006-12-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* gitweb: Add title attribute to ref marker with full ref nameJakub Narebski2006-12-16
| | | | | | | | | | | 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>
* gitweb: Do not show difftree for merges in "commit" viewJakub Narebski2006-12-16
| | | | | | | | | | 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>
* gitweb: SHA-1 in commit log message links to "object" viewJakub Narebski2006-12-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* gitweb: Hyperlink target of symbolic link in "tree" view (if possible)Jakub Narebski2006-12-12
| | | | | | | | | | | | | | | | | | | | | | | 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>
* gitweb: Add generic git_object subroutine to display object of any typeJakub Narebski2006-12-12
| | | | | | | | | | | 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>
* gitweb: Show target of symbolic link in "tree" viewJakub Narebski2006-12-12
| | | | | | | | | | | | | 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>
* gitweb: Don't use Content-Encoding: header in git_snapshotJakub Narebski2006-12-12
| | | | | | | | | | | 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>
* Fix documentation copy&paste typoUwe Zeisberger2006-12-08
| | | | | | | 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>
* gitweb: Allow PNG, GIF, JPEG images to be displayed in "blob" viewJakub Narebski2006-12-06
| | | | | | | | | | | | | | | | | 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>
* gitweb: Fix Atom feed <logo>: it is $logo, not $logo_urlJakub Narebski2006-12-04
| | | | | | | | 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>
* gitweb: Make project description in projects list link to summary viewJakub Narebski2006-11-25
| | | | | | | | | | | | | | Make (shortened) project description in the "projects list" view hyperlink to the "summary" view of the project. Project names are sometimes short; having project description be hyperling gives larger are to click. While at it, display full description on mouseover via 'title' attribute to introduced link. Additionally, fix whitespace usage in modified git_project_list_body subroutine: tabs are for indent, spaces are for align. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Use author_epoch for pubdate in gitweb feedsJakub Narebski2006-11-25
| | | | | | | | Use creation date (author_epoch) instead of former commit date (committer_epoch) as publish date in gitweb feeds (RSS, Atom). Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Add author and contributor email to Atom feedJakub Narebski2006-11-25
| | | | | | | | Add author email (from 'author_email') and contributor email (from 'committer_email') to items in the Atom format gitweb feed. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Add author and committer email extraction to parse_commitJakub Narebski2006-11-25
| | | | | | | | | Extract author email to 'author_email' key, and comitter mail to 'committer_mail' key; uniquify committer and author lines handling by the way. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Use git-show-ref instead of git-peek-remoteJakub Narebski2006-11-25
| | | | | | | | | | | | | | | Use "git show-ref --dereference" instead of "git peek-remote $projectroot/project" in git_get_references. git-show-ref is faster than git-peek-remote (40ms vs 56ms user+sys for git.git repository); even faster is reading info/refs file (if it exists), but the information in info/refs can be stale; that and the fact that info/refs is meant for dumb protocol transports, not for gitweb. git-show-ref is available since v1.4.4; the output format is slightly different than git-peek-remote output format, but we accept both. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Do not use esc_html in esc_pathJakub Narebski2006-11-25
| | | | | | | | | | Do not use esc_html in esc_path subroutine to avoid double quoting; expand esc_html body (except quoting) in esc_path. Move esc_path before quot_cec and quot_upr. Add some comments. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: (style) use chomp without parentheses consistently.Junio C Hamano2006-11-24
| | | | | | | | | It seems that gitweb tries to consistently use chomp without parentheses around its operands, but there were two places that said "chomp($var);". Let's be consistent. Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Replace SPC with &nbsp; also in tag commentJakub Narebski2006-11-24
| | | | | | | | Commit messages had SPC replaced with &nbsp; entity; make it so also in tag message (tag comment). Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Finish restoring "blob" links in git_difftree_bodyJakub Narebski2006-11-21
| | | | | | | | | | | | | | | | | | | | | | | This finishes work started by commit 4777b0141a4812177390da4b6ebc9d40ac3da4b5 "gitweb: Restore object-named links in item lists" by Petr Baudis. It brings back rest of "blob" links in difftree-raw like part of "commit" and "commitdiff" views, namely in git_difftree_body subroutine. Now the td.link table cell has the following links: * link to diff ("blobdiff" view) in "commit" view, if applicable (there is no link to uninteresting creation/deletion diff), or link to patch anchor in "commitdiff" view. * link to current version of file ("blob" view), with the obvious exception of file deletion, where it is link to the parent version. * link to "blame" view, if it is enabled, and file was not just created (i.e. it has any history). * link to history of the file ("history" view), again with sole exception of the case of new file. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Refactor feed generation, make output prettier, add Atom feedJakub Narebski2006-11-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support for more modern Atom web feed format. Both RSS and Atom feeds are generated by git_feed subroutine to avoid code duplication; git_rss and git_atom are thin wrappers around git_feed. Add links to Atom feed in HTML header and in page footer (but not in OPML; we should use APP, Atom Publishing Proptocol instead). Allow for feed generation for branches other than current (HEAD) branch, and for generation of feeds for file or directory history. Do not use "pre ${\sub_returning_scalar(...)} post" trick, but join strings instead: "pre " . sub_returning_scalar(...) . " post". Use href(-full=>1, ...) instead of hand-crafting gitweb urls. Make output prettier: * Use title similar to the title of web page * Use project description (if exists) for description/subtitle * Do not add anything (committer name, commit date) to feed entry title * Wrap the commit message in <pre> * Make file names into an unordered list * Add links (diff, conditional blame, history) to the file list. In addition to the above points, the attached patch emits a Last-Changed: HTTP response header field, and doesn't compute the feed body if the HTTP request type was HEAD. This helps keep the web server load down for well-behaved feed readers that check if the feed needs updating. If browser (feed reader) sent Accept: header, and it prefers 'text/xml' type to 'application/rss+xml' (in the case of RSS feed) or 'application/atom+xml' (in the case of Atom feed), then use 'text/xml' as content type. Both RSS and Atom feeds validate at http://feedvalidator.org and at http://validator.w3.org/feed/ Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Andreas Fuchs <asf@boinkor.net> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Add an option to href() to return full URLJakub Narebski2006-11-21
| | | | | | | | | | | href subroutine by default generates absolute URL (generated using CGI::url(-absolute=>1), and saved in $my_uri) using $my_uri as base; add an option to generate full URL using $my_url as base. New feature usage: href(..., -full=>1) Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: New improved formatting of chunk header in diffJakub Narebski2006-11-21
| | | | | | | | | | | | | | | | | | If we have provided enough info, and diff is not combined diff, and if provided diff line is chunk header, then: * split chunk header into .chunk_info and .section span elements, first containing proper chunk header, second section heading (aka. which function), for separate styling: the proper chunk header is on non-white background, section heading part uses slightly lighter color. * hyperlink from-file-range to starting line of from-file, if file was not created. * hyperlink to-file-range to starting line of to-file, if file was not deleted. Links are of invisible variety (and "list" class). Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Default to $hash_base or HEAD for $hash in "commit" and "commitdiff"Jakub Narebski2006-11-21
| | | | | | | | | | | | | | | Set $hash parameter to $hash_base || "HEAD" if it is not set (if it is not true to be more exact). This allows [hand-edited] URLs with 'action' "commit" or "commitdiff" but without 'hash' parameter. If there is 'h' (hash) parameter provided, then gitweb tries to use this. HEAD is used _only_ if nether hash, nor hash_base are provided, i.e. for URL like below URL?p=project.git;a=commit i.e. without neither 'h' nor 'hb'. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Buffer diff header to deal with split patches + git_patchset_body ↵Jakub Narebski2006-11-21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | refactoring There are some cases when one line from "raw" git-diff output (raw format) corresponds to more than one patch in the patchset git-diff output. To deal with this buffer git diff header and extended diff header (everything up to actual patch) to check from information from "index <hash>..<hash>" extended header line if the patch corresponds to the same or next difftree raw line. This could also be used to gather information needed for hyperlinking, and used for printing gitweb quoted filenames, from extended diff header instead of raw git-diff output. While at it, refactor git_patchset_body subroutine from the event-driven, AWK-like state-machine parsing to sequential parsing: for each patch parse (and output) git diff header, parse extended diff header, parse two-line from-file/to-file diff header, parse patch itself; patch ends with the end of input [file] or the line matching m/^diff /. For better understanding the code, there were added assertions in the comments a la Carp::Assert module. Just in case there is commented out code dealing with unexpected end of input (should not happen, hence commented out). Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Protect against possible warning in git_commitdiffJakub Narebski2006-11-21
| | | | | | | | We may read an undef from <$fd> and unconditionally chomping it would result in a warning. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Put back shortlog instead of graphiclog in the project list.Alexandre Julliard2006-11-15
| | | | | | | Looks like a repo.or.cz-specific change slipped in. Signed-off-by: Alexandre Julliard <julliard@winehq.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: fix unmatched div in commitdiffJunio C Hamano2006-11-09
| | | | | | | When the last filepair changed only metainfo we failed to close the extended header <div>. Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: protect commit messages from controls.Junio C Hamano2006-11-09
| | | | | | | | The same change as the previous. It is rather sad that commit log message parser gives list of chomped lines while tag message parser gives unchomped ones. Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: protect blob and diff output lines from controls.Junio C Hamano2006-11-09
| | | | | | | | This revealed that the output from blame and tag was not chomped properly and was relying on HTML output not noticing that extra whitespace that resulted from the newline, which was also fixed. Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: do not give blame link unconditionally in diff-tree viewJunio C Hamano2006-11-08
| | | | Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: New improved patchset viewJakub Narebski2006-11-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace "gitweb diff header" with its full sha1 of blobs and replace it by "git diff" header and extended diff header. Change also somewhat highlighting of diffs. Added `file_type_long' subroutine to convert file mode in octal to file type description (only for file modes which used by git). Changes: * "gitweb diff header" which looked for example like below: file:_<sha1 before>_ -> file:_<sha1 after>_ where 'file' is file type and '<sha1>' is full sha1 of blob is changed to diff --git _a/<file before>_ _b/<file after>_ In both cases links are visible and use default link style. If file is added, a/<file> is not hyperlinked. If file is deleted, b/<file> is not hyperlinked. * there is added "extended diff header", with <path> and <hash> hyperlinked (and <hash> shortened to 7 characters), and <mode> explained: '<mode>' is extended to '<mode> (<file type description>)', where added text is slightly lighter to easy distinguish that it was added (and it is difference from git-diff output). * from-file/to-file two-line header lines have slightly darker color than removed/added lines. * chunk header has now delicate line above for easier finding chunk boundary, and top margin of 2px, both barely visible. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Use character or octal escape codes (and add span.cntrl) in esc_pathJakub Narebski2006-11-08
| | | | | | | | | | | | | | | | | Instead of simply hiding control characters in esc_path by replacing them with '?', use Character Escape Codes (CEC) i.e. alphabetic backslash sequences like those found in C programming language and many other languages influenced by it, such as Java and Perl. If control characted doesn't have corresponding character escape code, use octal char sequence to escape it. Alternatively, controls can be replaced with Unicode Control Pictures U+2400 - U+243F (9216 - 9279), the Unicode characters reserved for representing control characters when it is necessary to print or display them. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: Better git-unquoting and gitweb-quoting of pathnamesJakub Narebski2006-11-08
| | | | | | | | | | | | | | | | | | | Extend unquote subroutine, which unquotes quoted and escaped filenames which git may return, to deal not only with octal char sequence quoting, but also quoting ordinary characters including '\"' and '\\' which are respectively quoted '"' and '\', and to deal also with C escape sequences including '\t' for TAB and '\n' for LF. Add esc_path subroutine for gitweb quoting and HTML escaping filenames (currently it does equivalent of ls' --hide-control-chars, which means showing undisplayable characters (including '\n' and '\t') as '?' (question mark) character, and use 'span' element with cntrl CSS class to help rendering them differently. Convert gitweb to use esc_path correctly to print pathnames. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: minimally fix "fork" support.Junio C Hamano2006-11-07
| | | | | | | | | | | | | | | A forked project is defined to be $projname/$forkname.git for $projname.git; the code did not check this correctly and mistook $projname/.git to be a fork of itself. This minimally fixes the breakage. Also forks were not checked when index.aux file was in use. Listing the forked ones in index.aux would show them also on the toplevel index which may go against the hierarchical nature of forks, but again this is a minimal fix to whip it in a better shape suitable to be in the 'master' branch. Signed-off-by: Junio C Hamano <junkio@cox.net>
* gitweb: fix disabling of "forks"Junio C Hamano2006-11-07
| | | | | | | | | Apparently this code was never tested without "forks". check-feature returns a one-element list (0) when disabled, and assigning that to a scalar variable made it to be called in a scalar context, which meant my $check_forks = gitweb_check_feature("forks") were always 1! Signed-off-by: Junio C Hamano <junkio@cox.net>
* Merge branch 'pb/web'Junio C Hamano2006-11-04
|\ | | | | | | | | * pb/web: gitweb: Support for 'forks'
| * gitweb: Support for 'forks'Petr Baudis2006-10-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On repo.or.cz, I want to support project 'forks', which are meant for repositories which are spinoffs of a given project and share its objects database through the alternates mechanism. But another (and perhaps even greater) incentive for that is that those 'forked projects' do not clutter the main project index but are completely grouped inside of the project view. A forked project is just like a normal project, but given project $projectroot/$projname.git, the forked project resides in directory $projectroot/$projname/$forkname.git. This is a somewhat arbitrary naming rule, but I think that for now it's fine; if someone will need something wildly different, let them submit a patch. The 'forked' mode is by default off and can be turned on in runtime gitweb configuration just like other features. A project having forks is marked by a '+' (pointing to the list of forks) in the project list (this could become some cutesy AJAXy DHTML in the future), there is a forks section in the project summary similar to the heads and tags sections, and of course a forks view which looks the same as the root project list. Forks can be recursive. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | gitweb: Remove extra "/" in path names for git_get_project_listAneesh Kumar K.V2006-11-04
| | | | | | | | | | | | | | | | | | | | | | Without this change we get a wrong $pfxlen value and the check_export_ok() checks with with a wrong directory name. Without this patch the below $projects_list fails with gitweb $projects_list = "/tmp/a/b/"; Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | gitweb: Better support for non-CSS aware web browsersJakub Narebski2006-11-02
| | | | | | | | | | | | | | | | | | | | | | | | | | Add option to replace SPC (' ') with hard (non-breakable) space HTML entity '&nbsp;' in esc_html subroutine. Replace ' ' with '&nbsp;' for the code/diff display part in git_blob and git_patchset_body; this is to be able to view code and diffs in web browsers which doesn't understand "white-space: pre;" CSS declaration. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | gitweb: Output also empty patches in "commitdiff" viewJakub Narebski2006-11-02
| | | | | | | | | | | | | | | | | | | | Remove skipping over empty patches (i.e. patches which consist solely of extended headers) in git_patchset_body, and add links to those header-only patches in git_difftree_body (but not generate blobdiff links when there were no change in file contents). Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | gitweb: Use git-for-each-ref to generate list of heads and/or tagsJakub Narebski2006-11-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add two subroutines: git_get_heads_list and git_get_refs_list, which fill out needed parts of refs info (heads and tags respectively) info using single call to git-for-each-ref, instead of using git-peek-remote to get list of references and using parse_ref for each ref to get ref info, which in turn uses at least one call of git command. Replace call to git_get_refs_list in git_summary by call to git_get_references, git_get_heads_list and git_get_tags_list (simplifying this subroutine a bit). Use git_get_heads_list in git_heads and git_get_tags_list in git_tags. Modify git_tags_body slightly to accept output from git_get_tags_list. Remove no longer used, and a bit hackish, git_get_refs_list. parse_ref is no longer used, but is left for now. Generating "summary" and "tags" views should be much faster for projects which have large number of tags. CHANGES IN OUTPUT: Before, if ref in refs/tags was tag pointing to commit we used committer epoch as epoch for ref, and used tagger epoch as epoch only for tag pointing to object of other type. If ref in refs/tags was commit, we used committer epoch as epoch for ref (see parse_ref; we sorted in gitweb by 'epoch' field). Currently we use committer epoch for refs pointing to commit objects, and tagger epoch for refs pointing to tag object, even if tag points to commit. Simple ab benchmark before and after this patch for my git.git repository (git/jnareb-git.git) with some heads and tags added as compared to git.git repository, shows around 2.4-3.0 times speedup for "summary" and "tags" views: summary 3134 +/- 24.2 ms --> 1081 +/- 30.2 ms tags 2886 +/- 18.9 ms --> 1196 +/- 15.6 ms Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | gitweb: Use 's' regexp modifier to secure against filenames with LFJakub Narebski2006-11-01
| | | | | | | | | | | | | | | | | | | | | | | | | | Use 's' (treat string as single line) regexp modifier in git_get_hash_by_path (against future changes, probably unnecessary) and in parse_ls_tree_line (when called with '-z'=>1 option) to secure against filenames containing newline. [jc: the hunk on git_get_hash_by_path was unneeded, and I noticed the regexp was doing unnecessary capture, so fixed it up while I was at it.] Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | gitweb: Secure against commit-ish/tree-ish with the same name as pathJakub Narebski2006-11-01
| | | | | | | | | | | | | | | | | | | | | | | | | | Add "--" after <commit-ish> or <tree-ish> argument to clearly mark it as <commit-ish> or <tree-ish> and not pathspec, securing against refs with the same names as files or directories in [live] repository. Some wrapping to reduce line length as well. [jc: with "oops, ls-tree does not want --" fix-up manually applied.] Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | gitweb: esc_html() author in blameLuben Tuikov2006-11-01
| | | | | | | | | | | | | | | | Blame fails for example on block/ll_rw_blk.c at v2.6.19-rc3. Signed-off-by: Luben Tuikov <ltuikov@yahoo.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | gitweb: Add "next" link to commitdiff viewJakub Narebski2006-10-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a kind of "next" view in the bottom part of navigation bar for "commitdiff" view. For commitdiff between two commits: (from: _commit_) For commitdiff for one single parent commit: (parent: _commit_) For commitdiff for one merge commit (merge: _commit_ _commit_ ...) For commitdiff for root (parentless) commit (initial) where _link_ denotes hyperlink. SHA1 is shortened to 7 characters on display, everything is perhaps unnecessary esc_html on display. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | gitweb: Move git_get_last_activity subroutine earlierJakub Narebski2006-10-28
| | | | | | | | | | | | | | | | This is purely cosmetic. Having git_get_* between two parse_* subroutines violated a good convention to group related things together. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | gitweb: Fix up bogus $stylesheet declarationsPetr Baudis2006-10-27
| | | | | | | | | | | | | | | | | | | | | | | | This seems to be a pre-++ residual declaration and it wasn't good for anything at all besides flooding the webserver errorlog with "omg, our in the same scope!!" warnings. [jc: the patch was bogus by defining the variable which defeated a later test that checked it with "defined", which I fixed up.] Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
* | Merge branch 'maint'Junio C Hamano2006-10-27
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | * maint: gitweb: Check git base URLs before generating URL from it Documentation: add git in /etc/services. Documentation: add upload-archive service to git-daemon. git-cherry: document limit and add diagram diff-format.txt: Correct information about pathnames quoting in patch format