aboutsummaryrefslogtreecommitdiff
path: root/gitweb
Commit message (Collapse)AuthorAge
...
* | | | gitweb: Add a per-repository authorization hook.Alexander Gavrilov2008-11-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a configuration variable that can be used to specify an arbitrary subroutine that will be called in the same situations where $export_ok is checked, and its return value used to decide whether the repository is to be shown. This allows the user to implement custom authentication schemes, for example by issuing a subrequest through mod_perl and checking if Apache will authorize it. Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com> Acked-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | gitweb: Use single implementation of export_ok check.Alexander Gavrilov2008-11-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GitWeb source contains a special function that implements the export_ok check, but validate_project still uses a separate copy of essentially the same code. This patch makes it use the dedicated function, thus ensuring that all checks are done through a single code path. Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com> Acked-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | | Merge branch 'jc/gitweb-fix-cloud-tag'Junio C Hamano2008-11-05
|\ \ \ \ | |/ / / |/| | | | | | | | | | | * jc/gitweb-fix-cloud-tag: Fix reading of cloud tags
| * | | Fix reading of cloud tagsJunio C Hamano2008-10-14
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The projectroot path could have SP in it, in which case iterating over <$git_dir/ctags/*> does not correctly enumerate the cloud tags files at all. This can be observed by creating an empty t/trash directory and running t9500 test. The $projectroot ends with "trash directory.t9500-gitweb-/" and <$glob> would give "trash", which can be opened and reading from it immediately yields undef, which in turn gives an undef value warning to the standard error stream upon attempt to chomp it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | gitweb: generate parent..current URLsGiuseppe Bilotta2008-10-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If use_pathinfo is enabled, href now creates links that contain paths in the form $project/$action/oldhash:/oldname..newhash:/newname for actions that use hash_parent etc. If any of the filename contains two consecutive dots, it's kept as a CGI parameter since the resulting path would otherwise be ambiguous. Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Acked-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | gitweb: parse parent..current syntax from PATH_INFOGiuseppe Bilotta2008-10-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch makes it possible to use an URL such as project/action/somebranch..otherbranch:/filename to get a diff between different version of a file. Paths like project/action/somebranch:/somefile..otherbranch:/otherfile are parsed as well. All '*diff' actions and in general actions that use $hash_parent[_base] and $file_parent (e.g. 'shortlog') can now get all of their parameters from PATH_INFO Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Acked-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | gitweb: use_pathinfo filenames start with /Giuseppe Bilotta2008-10-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Generate PATH_INFO URLs in the form project/action/hash_base:/filename rather than project/action/hash_base:filename (the latter form is still accepted in input). This minimal change allows relative navigation to work properly when viewing HTML files in raw ('blob_plain') mode. Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Acked-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | gitweb: generate project/action/hash URLsGiuseppe Bilotta2008-10-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | When generating path info URLs, reduce the number of CGI parameters by embedding action and hash_parent:filename or hash in the path. Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Acked-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | gitweb: parse project/action/hash_base:filename PATH_INFOGiuseppe Bilotta2008-10-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch enables gitweb to parse URLs with more information embedded in PATH_INFO, reducing the need for CGI parameters. The typical gitweb path is now $project/$action/$hash_base:$file_name or $project/$action/$hash This is mostly backwards compatible with the old-style gitweb paths, $project/$branch[:$filename], except when it was used to access a branch whose name matches a gitweb action. Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Acked-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | gitweb: refactor input parameters parse/validationGiuseppe Bilotta2008-10-12
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since input parameters can be obtained both from CGI parameters and PATH_INFO, we would like most of the code to be agnostic about the way parameters were retrieved. We thus collect all the parameters into the new %input_params hash, delaying validation after the collection is completed. Although the kludge removal is minimal at the moment, it makes life much easier for future expansions such as more extensive PATH_INFO use or other form of input such as command-line support. Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Acked-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | Merge branch 'pb/gitweb-tagcloud' into pb/gitwebShawn O. Pearce2008-10-03
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * pb/gitweb-tagcloud: gitweb: Support for simple project search form gitweb: Make the by_tag filter delve in forks as well gitweb: Support for tag clouds ... (+ many updates from master) ... Conflicts: gitweb/gitweb.perl
| * | gitweb: Support for simple project search formPetr Baudis2008-10-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is a trivial patch adding support for searching projects by name and description, making use of the "infrastructure" provided by the tag cloud generation. Signed-off-by: Petr Baudis <petr.baudis@novartis.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
| * | gitweb: Make the by_tag filter delve in forks as wellPetr Baudis2008-10-03
| | | | | | | | | | | | | | | | | | | | | | | | This requires us to build a full index including forks and then weed them out only when printing. Signed-off-by: Petr Baudis <petr.baudis@novartis.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
| * | gitweb: Support for tag cloudsPetr Baudis2008-10-03
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "Content tags" (nothing to do with usual Git tags!) are free-form strings that are attached to random projects and displayed in the well-known Web2.0-ish tag cloud above project list. The feature will make use of HTML::TagCloud if available, but will still display (less pretty) list of tags in case the module is not installed. The tagging itself is not done by gitweb - user-provided external helper CGI needs to be provided; one example is the tagproj.cgi of Girocco. This functionality might get integrated to gitweb in the future. The tags are stored one-per-file in ctags/ subdirectory. The reason they are not stored in the project config file is that you usually want to give anyone (even CGI scripts) permission to create new tags and they are non-essential information, and thus you would make the ctags/ subdirectory world-writable. Signed-off-by: Petr Baudis <petr.baudis@novartis.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
| * | Merge branch 'maint'Shawn O. Pearce2008-10-02
| |\ \ | | |/ | | | | | | | | | | | | | | | | | | * maint: gitweb: Add path_info tests to t/t9500-gitweb-standalone-no-errors.sh gitweb: Fix two 'uninitialized value' warnings in git_tree() Solaris: Use OLD_ICONV to avoid compile warnings gitweb: remove PATH_INFO from $my_url and $my_uri
| | * gitweb: Fix two 'uninitialized value' warnings in git_tree()Jakub Narebski2008-10-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we did try to access nonexistent directory or file, which means that git_get_hash_by_path() returns `undef`, uninitialized $hash variable was passed to 'open' call. Now we fail early with "404 Not Found - No such tree" error. (If we try to access something which does not resolve to tree-ish, for example a file / 'blob' object, the error will be caught later, as "404 Not Found - Reading tree failed" error). If we tried to use 'tree' action without $file_name ('f' parameter) set, which means either tree given by hash or a top tree (and we currently cannot distinguish between those two cases), we cannot print path breadcrumbs with git_print_page_path(). Fix this by moving call to git_print_page_path() inside conditional. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Acked-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
| | * gitweb: remove PATH_INFO from $my_url and $my_uriGiuseppe Bilotta2008-10-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes PATH_INFO handling by removing the relevant part from $my_url and $my_uri, thus making it unnecessary to specify them by hand in the gitweb configuration. Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Acked-by: Jakub Narebski <jnareb@gmail.com> Acked-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
| * | gitweb: Identify all summary metadata table rowsPetr Baudis2008-10-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the metadata table of the summary page, all rows have their id (or class in case of URL) set now. This for example lets sites easily disable fields they do not want to show in their custom stylesheet (e.g. they are overly technical or irrelevant for the site). Signed-off-by: Petr Baudis <petr.baudis@novartis.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
| * | gitweb: Quote non-displayable characters in hex, not octalPetr Baudis2008-10-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the last 30 years, the mankind uses the octal representation of characters only in rare cases and most character codes are hardly recognizable in octal. In contrast, many programmers still know hexadecimal well and that is also the representation of choice e.g. for Unicode codepoints. Signed-off-by: Petr Baudis <petr.baudis@novartis.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | | gitweb: Add support for extending the action bar with custom linksPetr Baudis2008-10-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | This makes it possible to easily extend gitweb with custom functionality, e.g. git-browser or web-based repository administration system like the repo.or.cz/Girocco duct tape. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | | gitweb: Sort the list of forks on the summary page by ageMike Ralphson2008-10-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The list of forks on the summary page was unsorted, this just makes them sorted by age, which seems a fair way to decide which forks are shown before the list size cut-off (15) kicks in. s/noheader/no_header was just to make it obvious what the parameter affects, so all the code can be found with one grep. pb: As suggested by Mike, I have augmented this by an additional patch that refactors the sorting logic so that it is not tied to printing the headers. Signed-off-by: Mike Ralphson <mike@abacus.co.uk> Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | | gitweb: Clean-up sorting of project listPetr Baudis2008-10-01
|/ / | | | | | | | | | | | | | | | | This decouples the sorting of project list and printing the column headers, so that the project list can be easily sorted even when the headers are not shown. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | gitweb: shortlog now also obeys $hash_parentGiuseppe Bilotta2008-09-25
| | | | | | | | | | | | | | | | | | If $hash_parent is defined, shortlog now limits the list of commits at those between $hash_parent (exclusive) and $hash (inclusive). Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Acked-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
* | Merge branch 'maint'Junio C Hamano2008-09-18
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | * maint: sha1_file: link() returns -1 on failure, not errno Make git archive respect core.autocrlf when creating zip format archives Add new test to demonstrate git archive core.autocrlf inconsistency gitweb: avoid warnings for commits without body Clarified gitattributes documentation regarding custom hunk header. git-svn: fix handling of even funkier branch names git-svn: Always create a new RA when calling do_switch for svn:// git-svn: factor out svnserve test code for later use diff/diff-files: do not use --cc too aggressively
| * gitweb: avoid warnings for commits without bodyJoey Hess2008-09-18
| | | | | | | | | | | | | | | | | | In the unusual case when there is no commit message, gitweb would output an uninitialized value warning. Signed-off-by: Joey Hess <joey@kitenet.net> Acked-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | gitweb: ref markers link to named shortlogsGiuseppe Bilotta2008-09-02
|/ | | | | | | | | | | | | | | | | | | | This patch turns ref markers for tags and heads into links to appropriate views for the ref name, depending on current context. For annotated tags, we link to the tag view, unless that's the current view, in which case we switch to shortlog. For other refs, we prefer the current view if it's history or (short)log, and default to shortlog otherwise. Appropriate changes are made in the CSS to prevent ref markers from being annoyingly blue and underlined, unless hovered. A visual indication of the target view difference is also implemented by making annotated tags show up in italic. Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com> Acked-by: Petr Baudis <pasky@suse.cz> Acked-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* gitweb: More about how gitweb gets 'owner' of repositoryJakub Narebski2008-07-27
| | | | | | Signed-off-by: Jakub Narebski <jnareb@gmail.com> Acked-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* gitweb: Describe projects_index format in more detailJakub Narebski2008-07-07
| | | | | | | | Update and extend information about $projects_list file format in gitweb/README and in gitweb/INSTALL. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge branch 'lw/gitweb'Junio C Hamano2008-06-25
|\ | | | | | | | | * lw/gitweb: gitweb: standarize HTTP status codes
| * gitweb: standarize HTTP status codesLea Wiemann2008-06-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many error status codes simply default to 403 Forbidden, which is not correct in most cases. This patch makes gitweb return semantically correct status codes. For convenience the die_error function now only takes the status code without reason as first parameter (e.g. 404 instead of "404 Not Found"), and it now defaults to 500 (Internal Server Error), even though the default is not used anywhere. Also documented status code conventions in die_error. Signed-off-by: Lea Wiemann <LeWiemann@gmail.com> Acked-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'jn/web'Junio C Hamano2008-06-22
|\ \ | | | | | | | | | | | | | | | * jn/web: gitweb: Separate generating 'sort by' table header gitweb: Separate filling list of projects info
| * | gitweb: Separate generating 'sort by' table headerJakub Narebski2008-06-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extract generating table header cell, for tables which can be sorted by its columns, into print_sort_th_str() and print_sort_th_num() subroutines, and print_sort_th() driver subroutine. This avoids repetition, and should make further improvements (like JavaScript sorting) easier. The subroutine uses now "replay" link, so it is generic enough to be able to use it for other tables which can be sorted by column, like for example 'heads' and 'tags' view (sort by name, or sort by age). Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * | gitweb: Separate filling list of projects infoJakub Narebski2008-06-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extract filling project list info, i.e. adding age, description, owner and forks information, into fill_project_list_info() subroutine. This is preparation for smart pagination and smart searching (to make it possible to calculate/generate info only for those projects which will be shown). Small changes compared to original version to improve readability (comments, names of variables, named loops). Additionally, store both full ('descr_long') and shortened ('descr') project description in Perl's internal form (using to_utf8). Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | | Merge branch 'rg/gitweb'Junio C Hamano2008-06-22
|\ \ \ | |_|/ |/| | | | | | | | * rg/gitweb: gitweb: remove git_blame and rename git_blame2 to git_blame
| * | gitweb: remove git_blame and rename git_blame2 to git_blameRafael Garcia-Suarez2008-06-09
| |/ | | | | | | | | | | | | | | | | git_blame is dead code. It's possible to plug it in place of git_blame2, but I don't know whether anyone does still that, because git_blame2 can now be considered stable enough, I think. Signed-off-by: Rafael Garcia-Suarez <rgarciasuarez@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | gitweb: remove unused parse_ref methodLea Wiemann2008-06-17
| | | | | | | | | | | | | | | | | | The parse_ref method became unused in cd1464083c, but the author decided to leave it in. Now it gets in the way of refactoring, so let's remove it. Signed-off-by: Lea Wiemann <LeWiemann@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | gitweb: quote commands properly when calling the shellLea Wiemann2008-06-17
| | | | | | | | | | | | | | | | | | This eliminates the function git_cmd_str, which was used for composing command lines, and adds a quote_command function, which quotes all of its arguments (as in quote.c). Signed-off-by: Lea Wiemann <LeWiemann@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | gitweb: Make it work with $GIT containing spacesJakub Narebski2008-06-14
|/ | | | | | | | This fixes single point where $GIT (which can contain full path to git binary) with embedded spaces gave errors. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* gitweb setup instruction: rewrite HEAD and root as wellAsk Bjørn Hansen2008-06-08
| | | | | | | | Also add a few more hints for how to setup and configure gitweb as described [jc: with a fix from Mike Hommey] Signed-off-by: Junio C Hamano <gitster@pobox.com>
* gitweb: Add charset info to "raw" output of 'text/plain' blobsJakub Narebski2008-06-04
| | | | | | | | | | | | | | | | | | | | | | | | Earlier "blob_plain" view sent "charset=utf-8" only when gitweb guessed the content type to be text by reading from it, and not when the MIME type was obtained from /etc/mime.types, or when gitweb couldn't guess mimetype and used $default_blob_plain_mimetype. This fixes the bug by always add charset info from $default_text_plain_charset (if it is defined) to "raw" (a=blob_plain) output for 'text/plain' blobs. Generating information for Content-Type: header got separated into blob_contenttype() subroutine; adding charset info in a special case was removed from blob_mimetype(), which now should return mimetype only. While at it cleanup code a bit: put subroutine parameter initialization first, make error message more robust (when $file_name is not defined) if more cryptic, remove unnecessary '"' around variable ("$var" -> $var). Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* gitweb: Fix "next" link on bottom of pageJakub Narebski2008-06-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix search form generation to not modify $cgi->param(...)'s. In git_header_html() we used to use $cgi->hidden(-name => "a") etc. to generate hidden fields; unfortunately to use this form it is required to modify $cgi->param("a") etc., which makes href(-replay,...) use wrong replay values. This for example made the "next" link on the bottom of the page has a=search instead of a=$action, and thus fails to get you to the next page. Because in CGI the value of a hidden field is "sticky", there is no way to modify it short of modifying $cgi->param(...). Therefore it got replaced by generating <input type="hidden" ...> element [semi] directly. Alternate solution would be for href(-replay,...) to use values saved in global variables, such as $action etc., instead of (re)reading them from $cgi->param($symbol). The bad link was reported by Kai Blin through http://bugs.debian.org/481902 Reported-by: Kai Blin <kai.blin@gmail.com> Signed-off-by: Jakub Narebski <jnareb@gmail.com> Tested-by: Gerrit Pape <pape@smarden.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* gitweb: Remove gitweb/test/ directoryJakub Narebski2008-05-31
| | | | | | | | | | | | Testing if gitweb handles filenames with spaces, filenames with plus sign ('+') which encodes spaces in CGI parameters (in URLs), and filenames with Unicode characters should be handled by gitweb tests. Those files are remainder of the time when gitweb was project on its own, not a part of git (with its testsuite). Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* Merge 1.5.5.3 inJunio C Hamano2008-05-27
|\
| * gitweb: only display "next" links in logs if there is a next pageLea Wiemann2008-05-27
| | | | | | | | | | | | | | | | | | There was a bug in the implementation of the "next" links in format_paging_nav (for log and shortlog), which caused the next links to always be displayed, even if there is no next page. This fixes it. Signed-off-by: Lea Wiemann <LeWiemann@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | gitweb: Convert string to internal form before chopping in chop_strAnders Waldenborg2008-05-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix chop_str not to cut in middle of utf8 multibyte chars. Without this fix at least author name in short log may cut in middle of a multibyte char. When the result comes to esc_html to_utf8 is called again, which doesn't find valid utf8 and decodes using $fallback_encoding making it even worse. This also have the nice side effect that it actually tries to show the first 10 _characters_, not the number of characters that happened to fit into 10 bytes. Signed-off-by: Anders Waldenborg <anders@0x63.nu> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | gitweb: Use feed link according to current viewJakub Narebski2008-04-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Michael G. Noll said in comments to the "Switching my code repository from Subversion (SVN) to git" article (http://tinyurl.com/37v67l) in his "My digital moleskine" blog, that one of the things he is missing in gitweb from SVN::Web is an RSS feed with news/information of the current view (including RSS feed for single file or directory). This is not exactly true, as since refactoring feed generation in af6feeb (gitweb: Refactor feed generation, make output prettier, add Atom feed, 2006-11-19), gitweb can generate feeds (RSS or Atom) for history of a given branch, history limited to a given directory, or history of a given file. Nevertheless this required handcrafting the URL to get wanted RSS feed. This commit makes gitweb select feed links in the HTML header and in page footer depending on current view (action). It is more elaborate, and I guess more correct, than simple patch adding $hash ('h') parameter to *all* URLs, including feed links, by Jean-Baptiste Quenot Subject: [PATCH] gitweb: Add hash parameter in feed URL when a hash is specified in the current request Message-ID: <ae63f8b50803211138y6355fd11pa64cda50a1f53011@mail.gmail.com> If $hash ('h') or $hash_base ('hb') parameter is a branch name (i.e. it starts with 'refs/heads/'; all generated URLs use this form to discriminate between tags and heads), it is used in feed URLs; if $file_name ('f') is defined, it is used in feed URLs. Feed title is set according to the kind of web feed: it is either 'log' for generic feed, 'log of <branch>', 'history of <filename>' for generic history (using implicit or explicit HEAD, i.e. current branch) or 'history of <filename> on <branch>'. There are special cases: 'heads' and 'forks' views should use OPML providing list of available feeds; 'tags' probably also should use OPML; there is no web feed equivalent to 'search' view. Currently all those cases fallback to (show) default feed. Such feed link uses "generic" class, and is shown in slightly lighter color for distinction. Currently feed can have but one starting point, and does not support negative (exclude) commit arguments. Therefore for now for *diff views it is chosen that feed follow the "to" part: to-name, to-commit for 'blobdiff', 'treediff' and 'commitdiff' views. Generating parameters for href() for feed link was separated (refactored) into get_feed_info() subroutine. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Merge branch 'maint'Junio C Hamano2008-04-22
|\ \ | |/ | | | | | | | | | | | | | | * maint: post-receive-email: fix accidental removal of a trailing space in signature line Escape project names before creating pathinfo URLs Escape project name in regexp bash: Add completion for git diff --base --ours --theirs diff-options.txt: document the new "--dirstat" option
| * Escape project names before creating pathinfo URLsmartin f. krafft2008-04-21
| | | | | | | | | | | | | | | | | | If a project name contains special URL characters like +, gitweb's links break in subtle ways. The solution is to pass the project name through esc_url() and using the return value. Signed-off-by: martin f. krafft <madduck@madduck.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
| * Escape project name in regexpmartin f. krafft2008-04-21
| | | | | | | | | | | | | | | | | | | | | | | | | | The project name, when used in a regular expression, needs to be quoted properly, so that stuff like '++' in the project name does not cause Perl to barf. Related info: http://bugs.debian.org/476076 This is a bug in Perl's CGI.pm, but fixing that exposed a similar bug in gitweb.perl Signed-off-by: martin f. krafft <madduck@madduck.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
* | Spelling fixes in the gitweb documentationRafael Garcia-Suarez2008-04-21
| | | | | | | | | | | | | | Mostly spelling and grammar nits. Signed-off-by: Rafael Garcia-Suarez <rgarciasuarez@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>