summaryrefslogtreecommitdiff
path: root/gitweb
AgeCommit message (Collapse)Author
2014-04-08Merge branch 'jl/nor-or-nand-and'Junio C Hamano
Eradicate mistaken use of "nor" (that is, essentially "nor" used not in "neither A nor B" ;-)) from in-code comments, command output strings, and documentations. * jl/nor-or-nand-and: code and test: fix misuses of "nor" comments: fix misuses of "nor" contrib: fix misuses of "nor" Documentation: fix misuses of "nor"
2014-03-31comments: fix misuses of "nor"Justin Lebar
Signed-off-by: Justin Lebar <jlebar@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2014-02-20gitweb: Avoid overflowing page body frame with large imagesAndrew Keller
When displaying a blob in gitweb, if it's an image, specify constraints for maximum display width and height to prevent the image from overflowing the frame of the enclosing page_body div. This change assumes that it is more desirable to see the whole image without scrolling (new behavior) than it is to see every pixel without zooming (previous behavior). Signed-off-by: Andrew Keller <andrew@kellerfarm.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-12gitweb: Denote non-heads, non-remotes branchesKrzesimir Nowak
Given two branches residing in refs/heads/master and refs/wip/feature the list-of-branches view will present them in following way: master feature (wip) When getting a snapshot of a 'feature' branch, the tarball is going to have name like 'project-wip-feature-<short hash>.tgz'. Signed-off-by: Krzesimir Nowak <krzesimir@endocode.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-12gitweb: Add a feature for adding more branch refsKrzesimir Nowak
Allow extra-branch-refs feature to tell gitweb to show refs from additional hierarchies in addition to branches in the list-of-branches view. Signed-off-by: Krzesimir Nowak <krzesimir@endocode.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-12gitweb: Return 1 on validation success instead of passed inputKrzesimir Nowak
Users of validate_* passing "0" might get failures on correct name because of coercion of "0" to false in code like: die_error(500, "invalid ref") unless (check_ref_format ("0")); Also, the validate_foo subs are renamed to is_valid_foo. Signed-off-by: Krzesimir Nowak <krzesimir@endocode.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-12-12gitweb: Move check-ref-format code into separate functionKrzesimir Nowak
This check will be used in more than one place later. Signed-off-by: Krzesimir Nowak <krzesimir@endocode.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-09-17Merge branch 'ab/gitweb-author-initials'Junio C Hamano
* ab/gitweb-author-initials: gitweb: Fix the author initials in blame for non-ASCII names
2013-09-11Merge branch 'tf/gitweb-ss-tweak'Junio C Hamano
Tweak Gitweb CSS to layout some elements better. * tf/gitweb-ss-tweak: gitweb: make search help link less ugly gitweb: omit the repository owner when it is unset gitweb: vertically centre contents of page footer gitweb: ensure OPML text fits inside its box
2013-08-30gitweb: Fix the author initials in blame for non-ASCII namesÆvar Arnfjörð Bjarmason
Change the @author_initials feature Jakub added in v1.6.4-rc2-14-ga36817b to match non-ASCII author initials as intended. The regexp Jakub added was intended to match non-ASCII (/\b([[:upper:]])\B/g). But in Perl this doesn't actually match non-ASCII upper-case characters unless the string being matched against has the UTF8 flag. So when we open a pipe to "git blame" we need to mark the file descriptor we're opening as utf8 explicitly. So as a result it abbreviates me to "AB" not "ÆAB", entirely because "Æ" isn't /[[:upper:]]/ unless the string being matched against has the UTF8 flag. Here's something that demonstrates the issue: #!/usr/bin/env perl use strict; use warnings; binmode STDOUT, ':utf8' if $ENV{UTF8}; open my $fd, "-|", "git", "blame", "--incremental", "--", "Makefile" or die "Can't open: $!"; binmode $fd, ":utf8" if $ENV{UTF8}; while (my $line = <$fd>) { next unless my ($author) = $line =~ /^author (.*)/; my @author_initials = ($author =~ /\b([[:upper:]])\B/g); printf "%s (%s)\n", join("", @author_initials), $author; } When that's run with and without UTF8 being true in the environment it gives, on git.git: $ UTF8=0 perl author-initials.pl | sort | uniq -c | sort -nr | head -n 5 99 JH (Junio C Hamano) 35 JN (Jonathan Nieder) 35 JK (Jeff King) 20 JS (Johannes Schindelin) 16 AB (Ævar Arnfjörð Bjarmason) $ UTF8=1 perl author-initials.pl | sort | uniq -c | sort -nr | head -n 5 99 JH (Junio C Hamano) 35 JN (Jonathan Nieder) 35 JK (Jeff King) 20 JS (Johannes Schindelin) 16 ÆAB (Ævar Arnfjörð Bjarmason) Acked-by: Jakub Narębski <jnareb@gmail.com> Tested-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Tested-by: Simon Ruderich <simon@ruderich.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-20gitweb: make search help link less uglyTony Finch
The search help link was a superscript question mark right next to a drop-down menu, which looks misaligned and is a cramped and awkward click target. Remove the superscript tags and add some spacing to fix these nits. Add a title attribute to provide an explanatory mouseover. Signed-off-by: Tony Finch <dot@dotat.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-20gitweb: omit the repository owner when it is unsetTony Finch
On the repository summary page, leave the owner line out if the repo does not have an owner, rather than displaying a labelled empty field. This does not affect the owner column in the projects list page, which is present unless $omit_owner is true. Signed-off-by: Tony Finch <dot@dotat.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-20gitweb: vertically centre contents of page footerTony Finch
Signed-off-by: Tony Finch <dot@dotat.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-08-20gitweb: ensure OPML text fits inside its boxTony Finch
The rss_logo CSS style has a fixed width which is too narrow for the string "OPML". Replace the fixed width with horizontal padding so the text fits with nice margins. Signed-off-by: Tony Finch <dot@dotat.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-07-05gitweb: allow extra breadcrumbs to prefix the trailTony Finch
There are often parent pages logically above the gitweb projects list, e.g. home pages of the organization and department that host the gitweb server. This change allows you to include links to those pages in gitweb's breadcrumb trail. Signed-off-by: Tony Finch <dot@dotat.at> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com> Acked-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-06-07gitweb: fix problem causing erroneous project listCharles McGarvey
The bug is manifest when running gitweb in a persistent process (e.g. FastCGI, PSGI), and it's easy to reproduce. If a gitweb request includes the searchtext parameter (i.e. s), subsequent requests using the project_list action--which is the default action--and without a searchtext parameter will be filtered by the searchtext value of the first request. This is because the value of the $search_regexp global (the value of which is based on the searchtext parameter) is currently being persisted between requests. Instead, clear $search_regexp before dispatching each request. Signed-off-by: Charles McGarvey <chazmcgarvey@brokenzipper.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-15gitweb/INSTALL: Simplify description of GITWEB_CONFIG_SYSTEMJakub Narębski
The flow of the text describing GITWEB_CONFIG_SYSTEM and GITWEB_CONFIG_COMMON in gitweb/INSTALL is awkward. "This is bad. Oh the other hand, better is broken. Therefore we do this." forces readers to make multiple guesses while reading: "ok, bad, so you plan to change it and warn us about upcoming change? oh, not that, changing it is bad, so we have to live with it? oh, not that, there is another one that is common and that is what we can use". Better rewrite said paragraph to avoid such a mental roller-coaster in the first place. Signed-off-by: Junio Hamano <gitster@pobox.com> Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-12Correct common spelling mistakes in comments and testsStefano Lattarini
Most of these were found using Lucas De Marchi's codespell tool. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Acked-by: Matthieu Moy <Matthieu.Moy@imag.fr> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-04-12doc: various spelling fixesStefano Lattarini
Most of these were found using Lucas De Marchi's codespell tool. Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-03-07gitweb/README: remove reference to git.kernel.orgFredrik Gustafsson
git.kernel.org no longer uses gitweb but has switched to cgit. Info about this can be found on: https://www.kernel.org/pelican.html or simply by looking at http://git.kernel.org . This is change since 2013-03-01. Signed-off-by: Fredrik Gustafsson <iveqy@iveqy.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-29gitweb: refer to picon/gravatar images over the same schemeAndrej E Baranov
With the current code, the images from picon and gravatar are requested over http://, and browsers give mixed contents warning when gitweb is served over https://. Just drop the scheme: part from the URL, so that these external sites are accessed over https:// in such a case. Signed-off-by: Andrej E Baranov <admin@andrej-andb.ru> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2013-01-12Merge branch 'os/gitweb-highlight-uncaptured' into maintJunio C Hamano
"gitweb", when sorting by age to show repositories with new activities first, used to sort repositories with absolutely nothing in it early, which was not very useful. * os/gitweb-highlight-uncaptured: gitweb: fix error in sanitize when highlight is enabled
2013-01-10Merge branch 'md/gitweb-sort-by-age' into maintJunio C Hamano
* md/gitweb-sort-by-age: gitweb: Sort projects with undefined ages last
2013-01-02gitweb: fix error in sanitize when highlight is enabledOrgad Shaneh
$1 becomes undef by internal regex, since it has no capture groups. Match against accpetable control characters using index() instead of a regex. Signed-off-by: Orgad Shaneh <orgads@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-12-11gitweb: Sort projects with undefined ages lastMatthew Daley
Sorting gitweb's project list by age ('Last Change') currently shows projects with undefined ages at the head of the list. This gives a less useful result when there are a number of projects that are missing or otherwise faulty and one is trying to see what projects have been updated recently. Fix by sorting these projects with undefined ages at the bottom of the list when sorting by age. Signed-off-by: Matthew Daley <mattjd@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-11-29Merge branch 'pp/gitweb-config-underscore'Junio C Hamano
The key "gitweb.remote_heads" is not legal git config; this maps it to "gitweb.remoteheads". * pp/gitweb-config-underscore: gitweb: make remote_heads config setting work
2012-11-28Merge branch 'rh/maint-gitweb-highlight-ext' into maintJunio C Hamano
Syntax highlighting in "gitweb" was not quite working. * rh/maint-gitweb-highlight-ext: gitweb.perl: fix %highlight_ext mappings
2012-11-21gitweb: make remote_heads config setting workPhil Pennock
Git configuration items can not contain underscores in their section and bottom-level variable name; the 'remote_heads' feature can not be enabled on a per-repository basis with that name. This changes the git-config option to be `gitweb.remoteheads` but does not change the gitweb.conf option, to avoid backwards compatibility issues. We strip underscores from keys before looking through git-config output for them. An existing check on keynames was overly eager to reject non-word letters, but if we ever start using three-level names, the middle level string can contain almost anything, so fix that as well while we are in the vicinity. Signed-off-by: Phil Pennock <phil@apcera.com> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-11-20Merge branch 'jk/maint-gitweb-xss'Junio C Hamano
Fixes an XSS vulnerability in gitweb. * jk/maint-gitweb-xss: gitweb: escape html in rss title
2012-11-12gitweb: escape html in rss titleJeff King
The title of an RSS feed is generated from many components, including the filename provided as a query parameter, but we failed to quote it. Besides showing the wrong output, this is a vector for XSS attacks. Signed-off-by: Jeff King <peff@peff.net>
2012-11-08gitweb.perl: fix %highlight_ext mappingsRichard Hubbell
When commit 592ea41 refactored the list of extensions for syntax highlighting, it failed to take into account perl's operator precedence within lists. As a result, we end up creating a dictionary of one-to-one elements when the intent was to map mutliple related types to one main type (e.g., bash, ksh, zsh, and sh should all map to sh since they share similar syntax, but we ended up just mapping "bash" to "bash" and so forth). This patch adds parentheses to make the mapping as the original change intended. It also reorganizes the list to keep mapped extensions together. Signed-off-by: Richard Hubbell <richard_hubbe11@lavabit.com> Signed-off-by: Jeff King <peff@peff.net>
2012-10-12gitweb.cgi: fix "comitter_tz" typo in feedDylan Alex Simon
gitweb's feeds sometimes contained committer timestamps in the wrong timezone due to a misspelling. Signed-off-by: Dylan Simon <dylan@dylex.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-09-10Merge branch 'maint-1.7.11' into maintJunio C Hamano
* maint-1.7.11: Almost 1.7.11.6 gitweb: URL-decode $my_url/$my_uri when stripping PATH_INFO rebase -i: use full onto sha1 in reflog sh-setup: protect from exported IFS receive-pack: do not leak output from auto-gc to standard output t/t5400: demonstrate breakage caused by informational message from prune setup: clarify error messages for file/revisions ambiguity send-email: improve RFC2047 quote parsing fsck: detect null sha1 in tree entries do not write null sha1s to on-disk index diff: do not use null sha1 as a sentinel value
2012-09-10Merge branch 'js/gitweb-path-info-unquote' into maint-1.7.11Junio C Hamano
"gitweb" when used with PATH_INFO failed to notice directories with SP (and other characters that need URL-style quoting) in them. * js/gitweb-path-info-unquote: gitweb: URL-decode $my_url/$my_uri when stripping PATH_INFO
2012-08-15gitweb: URL-decode $my_url/$my_uri when stripping PATH_INFOJay Soffian
When gitweb is used as a DirectoryIndex, it attempts to strip PATH_INFO on its own, as $cgi->url() fails to do so. However, it fails to account for the fact that PATH_INFO has already been URL-decoded by the web server, but the value returned by $cgi->url() has not been. This causes the stripping to fail whenever the URL contains encoded characters. To see this in action, setup gitweb as a DirectoryIndex and then use it on a repository with a directory containing a space in the name. Navigate to tree view, examine the gitweb generated html and you'll see a link such as: <a href="/test.git/tree/HEAD:/directory with spaces">directory with spaces</a> When clicked on, the browser will URL-encode this link, giving a $cgi->url() of the form: /test.git/tree/HEAD:/directory%20with%20spaces While PATH_INFO is: /test.git/tree/HEAD:/directory with spaces Fix this by calling unescape() on both $my_url and $my_uri before stripping PATH_INFO from them. Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Acked-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-24Merge branch 'nk/maint-gitweb-log-by-lines'Junio C Hamano
Teach gitweb to pay attention to various forms of credits that are similar to "Signed-off-by:" lines. * nk/maint-gitweb-log-by-lines: gitweb: Add support to Link: tag gitweb: Handle other types of tag in git_print_log gitweb: Cleanup git_print_log()
2012-07-05gitweb: Add support to Link: tagNamhyung Kim
The tip tree is the one of major subsystem tree in the Linux kernel project. On the tip tree, the Link: (or similar Buglink:) tag is used for tracking the original discussion or context. Since it's ususally in the S-o-b area, it'd be better using same style with others. Also as it tends to contain a message-id sent from git send-email, a part of the line would set a wrong hyperlink like [1]. Fix it by not using format_log_line_html(). [1] git.kernel.org/?p=linux/kernel/git/tip/tip.git;a=commit;h=08942f6d5d992e9486b07653fd87ea8182a22fa0 Signed-off-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-05gitweb: Handle other types of tag in git_print_logNamhyung Kim
There are many types of tags used in S-o-b area [1]. Update the regex to handle them properly. It requires the tag should be started by a capital letter and ended by '-by: ' or '-By: '. The only exception is 'Cc: '. [1] http://lwn.net/Articles/503829/ Signed-off-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-07-05gitweb: Cleanup git_print_log()Namhyung Kim
When we see a signed-off-by line (and its friends), we set $signoff to true, but then we process the next line after we are done without giving control to the rest of the loop. And when the line we saw is not a signed-off-by line, we reset $signoff to false before running the remainder of the loop. Hence, the check for $signoff that attempts to remove an extra empty line between two signed-off-by line was not doing anything useful. Rename $empty to a more explicit name $skip_blank_line to tell us to skip a blank line when we see one, set it after we see and emit a blank line (to avoid showing more than one empty lines in a raw) or after we handle a signed-off-by line (to avoid empty lines after such a line), to fix this bug, and get rid of the $signoff variable that is not useful. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-04-30Merge branch 'kk/gitweb-omit-expensive'Junio C Hamano
"gitweb" learned to optionally omit output of fields that are expensive to generate. By Kacper Kornet * kk/gitweb-omit-expensive: gitweb: Option to not display information about owner gitweb: Option to omit column with time of the last change
2012-04-30Merge branch 'kk/maint-gitweb-missing-owner'Junio C Hamano
By Kacper Kornet * kk/maint-gitweb-missing-owner: gitweb: Don't set owner if got empty value from projects.list
2012-04-26gitweb: Option to not display information about ownerKacper Kornet
In some setups the repository owner is not a well defined concept and administrator can prefer it to be not shown. This commit add and an option that enable to reach this effect. Signed-off-by: Kacper Kornet <draenog@pld-linux.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-04-25gitweb: Option to omit column with time of the last changeKacper Kornet
Generating information about last change for a large number of git repositories can be very time consuming. This commit add an option to omit 'Last Change' column when presenting the list of repositories. Signed-off-by: Kacper Kornet <draenog@pld-linux.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-04-25gitweb: Don't set owner if got empty value from projects.listKacper Kornet
Prevent setting owner to an empty value if it is not specified in projects.list file. Otherwise it stops retrieving information about the owner from other files. Signed-off-by: Kacper Kornet <draenog@pld-linux.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-04-24Merge branch 'mk/gitweb-diff-hl'Junio C Hamano
"gitweb" learns to highlight the patch it outputs even more. By Michał Kiedrowicz (7) and Jakub Narębski (1) * mk/gitweb-diff-hl: gitweb: Refinement highlightning in combined diffs gitweb: Highlight interesting parts of diff gitweb: Push formatting diff lines to print_diff_chunk() gitweb: Use print_diff_chunk() for both side-by-side and inline diffs gitweb: Extract print_sidebyside_diff_lines() gitweb: Pass esc_html_hl_regions() options to esc_html() gitweb: esc_html_hl_regions(): Don't create empty <span> elements gitweb: Use descriptive names in esc_html_hl_regions()
2012-04-16Merge branch 'wk/gitweb-snapshot-use-if-modified-since'Junio C Hamano
Makes 'snapshot' request to "gitweb" honor If-Modified-Since: header, based on the commit date. By W. Trevor King * wk/gitweb-snapshot-use-if-modified-since: gitweb: add If-Modified-Since handling to git_snapshot(). gitweb: refactor If-Modified-Since handling gitweb: add `status` headers to git_feed() responses.
2012-04-11gitweb: Refinement highlightning in combined diffsMichał Kiedrowicz
The highlightning of combined diffs is currently disabled. This is because output from a combined diff is much harder to highlight because it is not obvious which removed and added lines should be compared. Current code requires that the number of added lines is equal to the number of removed lines and only skips first +/- character, treating second +/- as a line content, Thus, it is not possible to simply use existing algorithm unchanged for combined diffs. Let's start with a simple case: only highlight changes that come from one parent, i.e. when every removed line has a corresponding added line for the same parent. This way the highlightning cannot get wrong. For example, following diffs would be highlighted: - removed line for first parent + added line for first parent context line -removed line for second parent +added line for second parent or - removed line for first parent -removed line for second parent + added line for first parent +added line for second parent but following output will not: - removed line for first parent -removed line for second parent +added line for second parent ++added line for both parents In other words, we require that pattern of '-'-es in pre-image matches pattern of '+'-es in post-image. Further changes may introduce more intelligent approach that better handles combined diffs. Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com> Acked-by: Jakub Narębski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-04-11gitweb: Highlight interesting parts of diffMichał Kiedrowicz
Reading diff output is sometimes very hard, even if it's colored, especially if lines differ only in few characters. This is often true when a commit fixes a typo or renames some variables or functions. This commit teaches gitweb to highlight characters that are different between old and new line with a light green/red background. This should work in the similar manner as in Trac or GitHub. The algorithm that compares lines is based on contrib/diff-highlight. Basically, it works by determining common prefix/suffix of corresponding lines and highlightning only the middle part of lines. For more information, see contrib/diff-highlight/README. Combined diffs are not supported but a following commit will change it. Since we need to pass esc_html()'ed or esc_html_hl_regions()'ed lines to format_diff_lines(), so it was taught to accept preformatted lines passed as a reference. Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com> Acked-by: Jakub Narębski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-04-11gitweb: Push formatting diff lines to print_diff_chunk()Michał Kiedrowicz
Now lines are formatted closer to place where we actually use HTML formatted output. This means that we put raw lines in the @chunk accumulator, rather than formatted lines. Because we still need to know class (type) of line when accumulating data to post-process and print, process_diff_line() subroutine was retired and replaced by diff_line_class() used in git_patchset_body() and new restructured format_diff_line() used in print_diff_chunk(). As a side effect, we have to pass \%from and \%to down to callstack. This is a preparation patch for diff refinement highlightning. It's not meant to change gitweb output. [jn: wrote commit message] Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com> Acked-by: Jakub Narębski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2012-04-11gitweb: Use print_diff_chunk() for both side-by-side and inline diffsMichał Kiedrowicz
This renames print_sidebyside_diff_chunk() to print_diff_chunk() and makes use of it for both side-by-side and inline diffs. Now diff lines are always accumulated before they are printed. This opens the possibility to preprocess diff output before it's printed, which is needed for diff refinement highlightning (implemented in incoming patches). If print_diff_chunk() was left as is, the new function print_inline_diff_lines() could reorder diff lines. It first prints all context lines, then all removed lines and finally all added lines. If the diff output consisted of mixed added and removed lines, gitweb would reorder these lines. This is true for combined diff output, for example: - removed line for first parent + added line for first parent -removed line for second parent ++added line for both parents would be rendered as: - removed line for first parent -removed line for second parent + added line for first parent ++added line for both parents To prevent gitweb from reordering lines, print_diff_chunk() calls print_diff_lines() as soon as it detects that both added and removed lines are present and there was a class change, and at the end of chunk. Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>