summaryrefslogtreecommitdiff
path: root/gitweb
AgeCommit message (Collapse)Author
2007-11-11Merge branch 'maint'Junio C Hamano
* maint: fix index-pack with packs >4GB containing deltas on 32-bit machines git-hash-object should honor config variables gitweb: correct month in date display for atom feeds
2007-11-10gitweb: correct month in date display for atom feedsVincent Zanotti
Signed-off-by: Vincent Zanotti <vincent.zanotti@m4x.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-03gitweb: Use config file for repository description and URLsJakub Narebski
Allow to use configuration variable gitweb.description for repository description if there is no $GIT_DIR/description file, and multivalued configuration variable gitweb.url for URLs of a project (to clone or fetch from) if there is no $GIT_DIR/cloneurl file. While repository description is shown in the projects list page, so it is better to use file and not config variable for performance, it is I think better to use gitweb.url for URLs (as it is shown only on project summary page). Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-03gitweb: Read repo config using 'git config -z -l'Jakub Narebski
Change git_get_project_config to run git-config only once per repository, without changing its signature (its calling convention). This means for example that it returns 'true' or 'false' when called with second argument '--bool', and not true or false value. Instead of calling 'git config [<type>] --get gitweb.<key>' once for each config variable, call 'git config -z -l' only once, parsing and saving its output to %config variable. This makes possible to add new per repository configuration without paying cost of forking once per variable checked. We can now allow repository description and repository URLs to be stored in config file without badly affecting gitweb performance. For now only configuration variables for 'gitweb' section are stored. Multiple values for single configuration variable are stored as anonymous array reference; configuration variable with no value is stored as undef. Converting configuration variable values to boolean or integer value are done in Perl. Results differ from git-config in the fact that no conversion error is ever raised. For boolean values no value, 'true' (any case) and 'false' (any case) are considered true, numbers are true if not zero; all other values (even invalid for bool) are considered false. For integer values value suffix of 'k', 'm', or 'g' following decimal number will cause the value to be multiplied by 1024, 1048576, or 1073741824; other values are returned as-is, only whitespace stripped. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-02gitweb: Use href(-replay=>1, action=>...) to generate alternate viewsJakub Narebski
Use href(action=>..., -replay=>1) to generate links to alternate views of current page in the $formats_nav (bottom) part of page_nav navigation bar. This form is used only when all parameters are repeated, and when the replay form is shorter. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-02gitweb: Use href(-replay=>1, page=>...) to generate pagination linksJakub Narebski
Use href(-replay=>1, page=>$page-1) and href(-replay=>1, page=>$page+1) to generate previous page and next page links. Generate next page link only once. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-02gitweb: Easier adding/changing parameters to current URLJakub Narebski
Add boolean option '-replay' to href() subroutine, which is used to generate links in gitweb. This option "replays" current URL, overriding it with provided parameters. It means that current value of each CGI parameter is used unless otherwise provided. This change is meant to make it easier to generate links which differ from current page URL only by one parameter, for example the same view but sorted by different column: href(-replay=>1, order=>"age") or view which differs by some option, e.g. in log views href(-replay=>1, extra_options=>"--no-merges") or alternate view of the same object, e.g. in the 'blob' view href(-replay=>1, action=>"blob_plain") Actual use of this functionality is left for later. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-02gitweb: Add 'status_str' to parse_difftree_raw_line outputJakub Narebski
Add 'status_str' to diffinfo output, which stores status (also for merge commit) as a string. This allows for easy checking if there is given status among all for merge commit, e.g. $diffinfo->{'status_str'} =~ /D/; Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-02gitweb: Always set 'from_file' and 'to_file' in parse_difftree_raw_lineJakub Narebski
Always set 'from_file' and 'to_file' keys when parsing raw diff output format line, even if filename didn't change (file was not renamed). This allows for simpler code. Previously, you would have written: $diffinfo->{'from_file'} || $diffinfo->{'file'} but now you can just use $diffinfo->{'from_file'} as 'from_file' is always defined. While at it, replace (for merge commits) $diffinfo->{'from_file'}[$i] || $diffinfo->{'to_file'} by defined $diffinfo->{'from_file'}[$i] ? $diffinfo->{'from_file'}[$i] : $diffinfo->{'to_file'}; to have no problems with file named '0'. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-02Merge branch 'maint'Junio C Hamano
* maint: git-format-patch.txt: fix explanation of an example. git-filter-branch.txt: fix a typo. git-clone.txt: Improve --depth description. gitweb: Update config file example for snapshot feature in gitweb/INSTALL
2007-11-01gitweb: Update config file example for snapshot feature in gitweb/INSTALLJakub Narebski
Commit a3c8ab30a54c30a6a434760bedf04548425416ef by Matt McCutchen "gitweb: snapshot cleanups & support for offering multiple formats" introduced new format of $feature{'snapshot'}{'default'} value. Update "Config file example" in gitweb/INSTALL accordingly. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-31Merge branch 'jn/web' into HEADJunio C Hamano
* jn/web: gitweb: Fix and simplify "split patch" detection
2007-10-30gitweb: Fix and simplify "split patch" detectionJakub Narebski
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; we call this situation "split patch". Old code misdetected subsequent patches (for different files) with the same pre-image and post-image as fragments of "split patch", leading to mislabeled from-file/to-file diff header etc. Old code used pre-image and post-image SHA-1 identifier ('from_id' and 'to_id') to check if current patch corresponds to old raw diff format line, to find if one difftree raw line coresponds to more than one patch in the patch format. Now we use post-image filename for that. This assumes that post-image filename alone can be used to identify difftree raw line. In the case this changes (which is unlikely considering current diff engine) we can add 'from_id' and 'to_id' to detect "patch splitting" together with 'to_file'. Because old code got pre-image and post-image SHA-1 identifier for the patch from the "index" line in extended diff header, diff header had to be buffered. New code takes post-image filename from "git diff" header, which is first line of a patch; this allows to simplify git_patchset_body code. A side effect of resigning diff header buffering is that there is always "diff extended_header" div, even if extended diff header is empty. Alternate solution would be to check when git splits patches, and do not check if parsed info from current patch corresponds to current or next raw diff format output line. Git splits patches only for 'T' (typechange) status filepair, and there always two patches corresponding to one raw diff line. It was not used because it would tie gitweb code to minute details of git diff output. While at it, use newly introduced parsed_difftree_line wrapper subroutine in git_difftree_body. Noticed-by: Yann Dirson <ydirson@altern.org> Diagnosed-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-25gitweb: Use chop_and_escape_str in more places.David Symonds
Signed-off-by: David Symonds <dsymonds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-25gitweb: Refactor abbreviation-with-title-attribute code.David Symonds
Signed-off-by: David Symonds <dsymonds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-22gitweb: Provide title attributes for abbreviated author names.David Symonds
Signed-off-by: David Symonds <dsymonds@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-10-17gitweb: speed up project listing on large work trees by limiting find depthLuke Lu
Signed-off-by: Luke Lu <git@vicaya.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-09-24gitweb: No difftree output for trivial mergeJakub Narebski
In 'commitdiff' view, for the merge commit, there is an extra header for the difftree table, with links to commitdiffs to individual parents. Do not show such header when there is nothing to show, for trivial merges. This means that for trivial merge you have to go to 'commit' view to get links to diffs to each parent. Signed-off-by: Jakub Narebski <jnareb@gmail.com>
2007-09-24gitweb: Remove parse_from_to_diffinfo code from git_patchset_bodyJakub Narebski
In commit 90921740bd00029708370673fdc537522aa48e6f "gitweb: Split git_patchset_body into separate subroutines" a part of git_patchset_body code was separated into parse_from_to_diffinfo subroutine. But instead of replacing the separated code by the call to mentioned subroutine, the call to subroutine was placed before the separated code. This patch removes parse_from_to_diffinfo code from git_patchset_body subroutine. Signed-off-by: Jakub Narebski <jnareb@gmail.com>
2007-08-29gitweb: Fix escaping HTML of project owner in 'projects_list' andJakub Narebski
'summary' views This for example allows to put email address in the project owner field in the projects index file (when $projects_list points to a file, and not to a directory), in the form of: path/to/repo.git Random+J+Developer+<random@developer.example.org> Noticed-by: Jon Smirl <jonsmirl@gmail.com> Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-27gitweb: Lift any characters restriction on searched stringsPetr Baudis
Everything is already fully quoted along the way so I believe this to be unnecessary at this point. It would pose trouble for regexp searches. Signed-off-by: Petr Baudis <pasky@suse.cz> Acked-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-26gitweb: Fix searchbox positioningPetr Baudis
Currently, searchbox is CSS'd to have position: absolute, which has the unfortunate consequence that if the viewport is too small and can't fit into the page width together with the navbar, it gets overlapped and part of the navbar gets obscured. This makes searchbox float: right instead, thus the navbar simply gets wrapped. Discovered and fix pointed out by Michael Olson <mwolson@gnu.org>. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-04gitweb: Fix handling of $file_name in feed generationJakub Narebski
The commit b6093a5c, by Robert Fitzsimons: "gitweb: Change atom, rss actions to use parse_commits." forgot to pass $file_name parameter to parse_commits subroutine. If git_feed is provided a file name, it ought to show only the history affecting that file or a directory. The title was being set correctly, but all commits from history were being shown. Signed-off-by: Steven Walter <stevenrwalter@gmail.com> Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-03gitweb: do not choke on recursive symlinkJunio C Hamano
If somebody used to advertise his repository that physically resides at /pub/lic.git/ as: git://git.example.com/pub/lic.git/ but now wants to use --base-path to allow: git://git.example.com/lic.git/ she can start git-daemon with --base-path option, like this: git-daemon --base-path=/pub --export-all During the transition, however, she would also want to allow older URL as well. One natural way to achieve that is to create a symlink: ln -s /pub /pub/pub so that a request to git://git.example.com/pub/lic.git/ is first translated by --base-path to a request to /pub/pub/lic.git/ which goes to /pub/lic.git, thanks to the symlink. So far so good. However, gitweb chokes if there is such a symlink (File::Find barfs with "/pub/pub is a recursive symbolic link"). Make the code ignore such a symlink. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-29gitweb: Allow for multivalued parameters passed to href subroutineJakub Narebski
Make it possible to generate URLs with multivalued parameters in the href() subroutine, via passing reference to array of values. Example: href(action=>"log", extra_options=>["--no-merges", "--first-parent"]) Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-29gitweb: Simplify 'opt' parameter validation, add "no merges" feedsJakub Narebski
Simplify and make more readable validation of 'opt' (extra options) parameter, using exists($hash{key}) instead of grepping keys of a hash for value. Move 'opt' parameter to be the last (for now) in the URL. Make use of '--no-merges' extra option ('opt') by adding "no merges" RSS and Atom feeds to the HTML header. Note that alternate format links in the RSS and Atom views do not use '--no-merges' option yet! Adds tests for the 'opt' parameter to t9500-gitweb-standalone-no-errors.sh Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-29gitweb: Show submodule entries in the 'tree' viewJakub Narebski
Add S_ISGITLINK subroutine and S_IFGITLINK, S_IFINVALID constants. Add support for "commit" (submodule) entries in the tree object to mode_str ('m---------', following cgit), file_type and file_type_long ('submodule') subroutines. There is only link to the history of submodule entry in the supermodule (current repository) for now, because gitweb doesn't know where to search for submodule repository objects. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-25gitweb: fix broken snapshotJunio C Hamano
Recent updates to snapshot code had a typo that broke the command line to invoke underlying "git archive" command. This is a simple typofix for it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-25gitweb: More detailed error messages for snapshot formatJakub Narebski
Improve error messages for snapshot format in git_snapshot: distinguish between situation where snapshots are turned off, where snapshot format ('sf') parameter is invalid, where given snapshot format does not exist in %known_snapshot_formats hash, and where gitweb was given unsupported snapshot format. While at it, use first from all supported snapshots format as default, if no snapshot format was provided. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-22gitweb: Fix support for legacy gitweb config for snapshotsJakub Narebski
Earlier commit which cleaned up snapshot support and introduced support for multiple snapshot formats changed the format of $feature{'snapshot'}{'default'} (gitweb configuration) and gitweb.snapshot configuration variable (repository configuration). It supported old gitweb.snapshot values of 'gzip', 'bzip2' and 'zip' and tried to support, but failed to do that, old values of $feature{'snapshot'}{'default'}; at least those corresponding to old gitweb.snapshot values of 'gzip', 'bzip2' and 'zip', i.e. ['x-gzip', 'gz', 'gzip'] ['x-bzip2', 'bz2', 'bzip2'] ['x-zip', 'zip', ''] This commit moves legacy configuration support out of feature_snapshot subroutine to separate filter_snapshot_fmts subroutine. The filter_snapshot_fmts is used on result on result of gitweb_check_feature('snapshot'). This way feature_snapshot deals _only_ with repository config. As a byproduct you can now use 'gzip' and 'bzip2' as aliases to 'tgz' and 'tbz2' also in $feature{'snapshot'}{'default'}, not only in gitweb.snapshot. While at it do some whitespace cleanup: use tabs for indent, but spaces for align. Noticed-by: Matt McCutchen <hashproduct@gmail.com> Signed-off-by: Jakub Narebski <jnareb@gmail.com> Tested-by: Matt McCutchen <hashproduct@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-22gitweb: snapshot cleanups & support for offering multiple formatsMatt McCutchen
- Centralize knowledge about snapshot formats (mime types, extensions, commands) in %known_snapshot_formats and improve how some of that information is specified. In particular, zip files are no longer a special case. - Add support for offering multiple snapshot formats to the user so that he/she can download a snapshot in the format he/she prefers. The site-wide or project configuration now gives a list of formats to offer, and if more than one format is offered, the "_snapshot_" link becomes something like "snapshot (_tar.bz2_ _zip_)". - If only one format is offered, a tooltip on the "_snapshot_" link tells the user what it is. - Fix out-of-date "tarball" -> "archive" in comment. Alert for gitweb site administrators: This patch changes the format of $feature{'snapshot'}{'default'} in gitweb_config.perl from a list of three pieces of information about a single format to a list of one or more formats you wish to offer from the set ('tgz', 'tbz2', 'zip'). Update your gitweb_config.perl appropriately. There was taken care for old-style gitweb configuration to work as it used to, but this backward compatibility works only for the values which correspond to gitweb.snapshot values of 'gzip', 'bzip2' and 'zip', i.e. ['x-gzip', 'gz', 'gzip'] ['x-bzip2', 'bz2', 'bzip2'] ['x-zip', 'zip', ''] The preferred names for gitweb.snapshot in repository configuration have also changed from 'gzip' and 'bzip2' to 'tgz' and 'tbz2', but the old names are still recognized for compatibility. Signed-off-by: Matt McCutchen <hashproduct@gmail.com> Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-20gitweb cleanup: Move @diff_opts declaration earlierJakub Narebski
Move @diff_opts declaration earlier, so that all gitweb options are together (and not separated by %feature hash and some subroutines), with the exception of $GITWEB_CONFIG which must be after all option variables including %feature hash. While at it, in the moved comment, note that diff option '-C' implies '-M', instead of suggesting that '-M', '-C' is required. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-12gitweb: new cgi parameter: optMiklos Vajna
Currently the only supported value is '--no-merges' for the 'rss', 'atom', 'log', 'shortlog' and 'history' actions, but it can be easily extended to allow other parameters for other actions. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-11gitweb: configurable width for the projects list Description columnMichael Hendricks
This allows gitweb users to set $projects_list_description_width in their gitweb.conf to determine how many characters of a project description are displayed before being truncated with an ellipsis. Signed-off-by: Michael Hendricks <michael@ndrix.org> Acked-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-07gitweb: make "No commits" in project list gray, not bold greenMatt McCutchen
A missing return statement in git_get_last_activity made gitweb think a project with no commits was in age class "age0", so the "No commits" appeared in bold green, which was ridiculous. I added the return so those projects get "noage" and added a block to gitweb.css to format the "No commits" text gray. Signed-off-by: Matt McCutchen <hashproduct@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-07gitweb: make search form generate pathinfo-style URLsMatt McCutchen
The search form generated traditional-style URLs with a "p=" parameter even when the pathinfo feature was on. This patch makes it generate pathinfo-style URLs when appropriate. Signed-off-by: Matt McCutchen <hashproduct@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-07gitweb: prefer git_get_project_owner() over get_file_owner()Miklos Vajna
This way if $projects_list exists, it'll be used, otherwise get_file_owner() will be used as before. Signed-off-by: Miklos Vajna <vmiklos@frugalware.org> Acked-by: Luben Tuikov <ltuikov@yahoo.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-07-07gitweb: make repeated calls to git_get_project_owner() bearableJunio C Hamano
If repeated calls to git_get_project_owner() are made, we would have read the same file over and over again. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-13gitweb: change filename/directory name of snapshotsMatthias Lederhofer
/.git or .git is removed from the project name and the basename of the remaining path is used as the beginning of the filename and as the directory in the archive. The regexp will actually not strip off /.git or .git if there wouldn't be anything left after removing it. Currently the full project name is used as directory in the archive and the basename is used as filename. For example a repository named foo/bar/.git will have a archive named .git-<version>.* and extract to foo/bar/.git. With this patch the file is named bar-<version>.* and extracts to bar. Signed-off-by: Matthias Lederhofer <matled@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-10gitweb: '--cc' for merges in 'commitdiff' viewJakub Narebski
Allow choosing between '-c' (combined diff) and '--cc' (compact combined) diff format in 'commitdiff' view for merge (multiparent) commits. Default is now '--cc'. In the bottom part of navigation bar there is link allowing to change diff format: "combined" for '-c' (when using '--cc') and "compact" for '--cc' (when using '-c'), just on the right of "raw" link to 'commitdiff_plain" view. About patchset part of diff --cc output: the difftree (whatchanged table) has "patch" links to anchors to individual patches (on the same page). The --cc option further compresses the patch output by omitting some hunks; when this optimization makes all hunks disappear, the patch is not shown (like in any other "empty diff" case). But the fact that patch has been simplified out is not reflected in the raw (difftree) part of diff output; the raw part is the same for '-c' and '--cc' options. As correcting difftree is rather out of the question, as it would require scanning patchset part before writing out difftree, we add "Simple merge" empty diffs as a place to have anchor to in place of those simplified out and removed patches. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-10gitweb: Add links to blobdiffs in from-file/to-file header for mergesJakub Narebski
Add links to diff to file ('blobdiff' view) for each of individual versions of the file in a merge commit to the from-file/to-file header in the patch part of combined 'commitdiff' view for merges. The from-file/to-file header for combined diff now looks like: --- _1_/_git-gui/git-gui.sh_ --- _2_/_git-gui.sh_ +++ b/_git-gui/git-gui.sh_ where _<filename>_ link is link to appropriate version of a file ('blob' view), and _<n>_ is link to respective diff to mentioned version of a file ('blobdiff' view). There is even hint provided in the form of title attribute. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-10gitweb: Create special from-file/to-file header for combined diffJakub Narebski
Instead of using default, diff(1) like from-file/to-file header for combined diff (for a merge commit), which looks like: --- a/git-gui/git-gui.sh +++ b/_git-gui/git-gui.sh_ (where _link_ denotes [hidden] hyperlink), create from-file(n)/to-file header, using "--- <n>/_<filename>_" for each of parents, e.g.: --- 1/_git-gui/git-gui.sh_ --- 2/_git-gui.sh_ +++ b/_git-gui/git-gui.sh_ Test it on one of merge commits involving rename, e.g. 95f97567c1887d77f3a46b42d8622c76414d964d (rename at top) 5bac4a671907604b5fb4e24ff682d5b0e8431931 (file from one branch) This is mainly meant to easier see renames in a merge commit. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-10gitweb: Split git_patchset_body into separate subroutinesJakub Narebski
This commit makes git_patchset_body easier to read, and reduces level of nesting and indent level. It adds more lines that it removes because of extra parameter passing in subroutines, and subroutine calls in git_patchset_body. Also because there are few added comments. Below there are descriptions of all split-off subroutines: Separate formatting "git diff" header into format_git_diff_header_line. While at it fix it so it always escapes pathname. It would be even more useful if we decide to use `--cc' for merges, and need to generate by hand empty patches for anchors. Separate formatting extended (git) diff header lines into format_extended_diff_header_line. This one is copied without changes. Separate formatting two-lines from-file/to-file diff header into format_diff_from_to_header subroutine. While at it fix it so it always escapes pathname. Beware calling convention: it takes _two_ lines. Separate generating %from and %to hashes (with info used among others to generate hyperlinks) into parse_from_to_diffinfo subroutine. This one is copied without changes. Separate checking if file was deleted (and among others therefore does not have link to the result file) into is_deleted subroutine. This would allow us to easily change the algotithm to find if file is_deleted in the result. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-10gitweb: Improve "next" link in commitdiff viewJakub Narebski
Check if 'hp' (hash_parent) parameter to 'commitdiff' view is one of 'h' (hash) commit parents, i.e. if commitdiff is of the form "<commit>^<n> <commit>", and mark it as such in the bottom part of navigation bar. The "next" link in commitdiff view was introduced in commit 151602df00b8e5c5b4a8193f59a94b85f9b5aebc If 'hb' is n-th parent of 'h', show the following at the bottom of navigation bar: (from parent n: _commit_) Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-10gitweb: Provide links to commitdiff to each parent in 'commitdiff' viewJakub Narebski
Since commit-fb1dde4a we show combined diff for merges in 'commitdiff' view, and since commit-208ecb2e also in 'commit' view. Sometimes though one would want to see diff to one of merge commit parents. It is easy in 'commit' view: in the commit header part there are "diff" links for each of parent header. This commit adds such links also for 'commitdiff' view. Add to difftree / whatchanged table row with "1", "2", ... links to 'commitdiff' view for diff with n-th parent for merge commits, as a table header. This is visible only in 'comitdiff' view, and only for a merge commit (comit with more than one parent). To save space links are shown as "n", where "n" is number of a parent, and not as for example shortened (to 7 characters) sha1 of a parent commit. To make it easier to discover what links is for, each link has 'title' attribute explaining the link. Note that one would need to remember that difftree table in 'commit' view has one less column (it doesn't have "patch" link column), if one would want to add such table header also in 'commit' view. Example output: 1 2 3 Makefile patch | diff1 | diff2 | diff3 | blob | history cache.h patch | diff1 | diff2 | diff3 | blob | history Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-07War on whitespaceJunio C Hamano
This uses "git-apply --whitespace=strip" to fix whitespace errors that have crept in to our source files over time. There are a few files that need to have trailing whitespaces (most notably, test vectors). The results still passes the test, and build result in Documentation/ area is unchanged. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-06-03gitweb: Handle non UTF-8 text betterMartin Koegler
gitweb assumes that everything is in UTF-8. If a text contains invalid UTF-8 character sequences, the text must be in a different encoding. This commit introduces $fallback_encoding which would be used as input encoding if gitweb encounters text with is not valid UTF-8. Add basic test for this in t/t9500-gitweb-standalone-no-errors.sh Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at> Signed-off-by: Jakub Narebski <jnareb@gmail.com> Tested-by: Alexandre Julliard <julliard@winehq.org> Tested-by: Ismail Dönmez <ismail@pardus.org.tr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-05-23gitweb.perl - Optionally send archives as .zip filesMark Levedahl
git-archive already knows how to generate an archive as a tar or a zip file, but gitweb did not. zip archvies are much more usable in a Windows environment due to native support and this patch allows a site admin the option to deliver zip rather than tar files. The selection is done by inserting $feature{'snapshot'}{'default'} = ['x-zip', 'zip', '']; in gitweb_config.perl. Tar files remain the default option. Signed-off-by: Mark Levedahl <mdl123@verizon.net> Acked-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-19gitweb: Fix "Use of uninitialized value" warning in git_feedJakub Narebski
Initial (root) commit has no parents, and $co{'parent'} is undefined. Use '--root' for initial commit. This fixes "Use of uninitialized value in open at gitweb/gitweb.perl line 4925." warning. Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-05-19gitweb: Remove redundant $searchtype setupPetr Baudis
Sorry, this was inadverently introduced by my grep search patch. It causes annoying "redefined" warnings. Signed-off-by: Petr Baudis <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>