summaryrefslogtreecommitdiff
path: root/gitweb
AgeCommit message (Collapse)Author
2007-05-08gitweb: Add combined diff support to git_difftree_bodyJakub Narebski
You have to pass all parents as final parameters of git_difftree_body subroutine; the number of parents of a diff must be equal to the number derived from parsing git-diff-tree output, raw combined diff for git_difftree_body to display combined diff correctly (but it is not checked). Currently the possibility of displaying diffree of combined diff is not used in gitweb code; git_difftree_body is always caled for ordinary diff, and with only one parent. Description of output for combined diff: ---------------------------------------- The difftree table for combined diff starts with a cell with pathname of changed blob (changed file), which if possible is hidden link (class="list") to the 'blob' view of final version (if it exists), like for difftree for ordinary diff. If file was deleted in the final commit then filename is not hyperlinked. There is no cell with single file status (new, deleted, mode change, rename), as for combined diff as there is no single status: different parents might have different status. If git_difftree_body was called from git_commitdiff (for 'commitdiff' action) there is inner link to anchor to appropriate fragment (patch) in patchset body; the "patch" link does not replace "diff" link like for ordinary diff. Each of "diff" links is in separate cell, contrary to output for ordinary diff in which all links are (at least for now) in a single cell. For each parent, if file was not present we leave cell empty. If file was deleted in the result, we provide link to 'blob' view. Otherwise we provide link to 'commitdiff' view, even if patch (diff) consist only of extended diff header, and contents is not changed (pure rename, pure mode change). The only difference is that link to "blobdiff" view with no contents change is with 'nochange' class. At last, there is provided link to current version of file as "blob" link, if the file was not deleted in the result, and lik to history of a file, if there exists one. (The link to file history might be confused, at least for now, by renames.) Note that git-diff-tree raw output dor combined diff does not provide filename before change for renames and copies; we use git_get_path_by_hash to get "src" filename for renames (this means additional call to git-ls-tree for a _whole_ tree). Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-08gitweb: Add parsing of raw combined diff format to parse_difftree_raw_lineJakub Narebski
Add parsing line of raw combined diff ("git diff-tree -c/-cc" output) as described in section "diff format for merges" in diff-format.txt to parse_difftree_raw_line subroutine. Returned hash (or hashref) has for combined diff 'nparents' key which holds number of parents in a merge. At keys 'from_mode' and 'from_id' there are arrayrefs holding modes and ids, respectively. There is no 'similarity' value, and there is only 'to_file' value and no 'from_file' value. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-04Merge branch 'maint'Junio C Hamano
* maint: gitweb: use decode_utf8 directly posix compatibility for t4200 Document 'opendiff' value in config.txt and git-mergetool.txt Allow PERL_PATH="/usr/bin/env perl" Make xstrndup common diff.c: fix "size cache" handling. http-fetch: Disable use of curl multi support for libcurl < 7.16.
2007-05-04gitweb: use decode_utf8 directlyIsmail Dönmez
Using decode() tries to decode data that is already UTF-8 and borks, but decode_utf8 from Encode.pm has a built-in safety against that. Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-23gitweb: Show "no difference" message for empty diffv1.5.2-rc0Martin Koegler
Currently, gitweb shows only header and footer, if no differences are found. This patch adds a "No differences found" message for the html output. Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at> Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-11gitweb: Allow configuring the default projects order and add order 'none'Frank Lichtenheld
Introduce new configuration variable $default_projects_order that can be used to specify the default order of projects on the index page if no 'o' parameter is given. Allow a new value 'none' for order that will cause the projects to be in the order we learned about them. In case of reading the list of projects from a file, this should be the order as they are listed in the file. In case of reading the list of projects from a directory this will probably give random results depending on the filesystem in use. Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de> Acked-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-11gitweb: Allow forks with project list fileFrank Lichtenheld
Make it possible to use the forks feature even when reading the list of projects from a file, by creating a list of known prefixes as we go. Forks have to be listed after the main project in order to be recognised as such. Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de> Acked-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-05Merge branch 'maint'Junio C Hamano
* maint: Fix lseek(2) calls with args 2 and 3 swapped Honor -p<n> when applying git diffs Fix dependency of common-cmds.h Fix renaming branch without config file DESTDIR support for git/contrib/emacs gitweb: Fix bug in "blobdiff" view for split (e.g. file to symlink) patches Document --left-right option to rev-list. Revert "builtin-archive: use RUN_SETUP" rename contrib/hooks/post-receieve-email to contrib/hooks/post-receive-email. rerere: make sorting really stable. Fix t4200-rerere for white-space from "wc -l"
2007-04-05gitweb: Fix bug in "blobdiff" view for split (e.g. file to symlink) patchesJakub Narebski
git_patchset_body needs patch generated with --full-index option to detect split patches, meaning two patches which corresponds to single difftree (raw diff) entry. An example of such situation is changing type (mode) of a file, e.g. from plain file to symbolic link. Add, in git_blobdiff, --full-index option to patch generating git diff invocation, for the 'html' format output ("blobdiff" view). "blobdiff_plain" still uses shortened sha1 in the extended git diff header "index <hash>..<hash>[ <mode>]" line. Noticed-by: Martin Koegler <mkoegler@auto.tuwien.ac.at> Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-04gitweb: Quote hash keys, and do not use barewords keysJakub Narebski
Ensure that in all references to an element of a hash, the key is singlequoted, instead of using bareword: use $hash{'key'} instead of $hash{key} Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-04-04gitweb: Whitespace cleanup - tabs are for indent, spaces are for align (3)Jakub Narebski
Code should be look the same way, regardless of tab size. Use tabs for indent, but spaces for align. Indent continued part of command spanning multiple lines, but only once. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-31gitweb: Support comparing blobs (files) with different namesJakub Narebski
Fix the bug that caused "blobdiff" view called with new style URI for a rename with change diff to be show as new (added) file diff. New style URI for "blobdiff" for rename means with $hash_base ('hb') and $hash_parent_base ('hpb') paramaters denoting tree-ish (usually commit) of a blobs being compared, together with both $file_name ('f') and $file_parent ('fp') parameters. It is done by adding $file_parent ('fp') to the path limiter, meaning that diff command becomes: git diff-tree [options] hpb hb -- fp f Other option would be finding hash of a blob using git_get_hash_by_path subroutine and comparing blobs using git-diff, or using extended SHA-1 syntax and compare blobs using git-diff: git diff [options] hpb:fp hp:f Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-27gitweb: Cleanup and uniquify die_error callsJakub Narebski
Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-26gitweb: Add example of config file and how to generate projects list to ↵Jakub Narebski
gitweb/INSTALL Add simple example of config file (turning on and allowing override of a few %features). Also example config file and script to generate list of projects in a format that can be used as GITWEB_LIST / $projects_list. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-25gitweb: Add some installation notes in gitweb/INSTALLJakub Narebski
Add some installation and configuration notes for gitweb in gitweb/INSTALL. Make use of filling gitweb configuration by Makefile. It does not cover (yet?) all the configuration variables and options. Some of contents duplicates information in gitweb/README file (it is referred from gitweb/INSTALL). Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-25gitweb: Fix not marking signoff lines in "log" viewJakub Narebski
The CSS selector for signoff lines style was too strict: in the "log" view the commit message is not encompassed in container "page_body" div. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-03-25gitweb: 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-25gitweb: 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-03-23gitweb: Fix "next" link in commit viewJakub Narebski
Fix copy'n'paste error in commit c9d193df which caused that "next" link for merge commits in "commit" view (merge: _commit_ _commit_ ...) was to "commitdiff" view instead of being to "commit" view. Signed-off-by: Jakub Narebski <jnareb@gmail.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>