Re: [PATCH v3 7/8] gitweb: Highlight interesting parts of diff

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Michał Kiedrowicz <michal.kiedrowicz@xxxxxxxxx> wrote:

> 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@xxxxxxxxx>
> Acked-by: Jakub Narębski <jnareb@xxxxxxxxx>

Junio,

can you please fixup this patch?  I just noticed "chomp $rem, $add" breaks
the testsuite.

diff --git a/gitweb/gitweb.perl b/gitweb/gitweb.perl
index e4351fe..961fbdc 100755
--- a/gitweb/gitweb.perl
+++ b/gitweb/gitweb.perl
@@ -5067,7 +5067,8 @@ sub format_rem_add_lines_pair {

        # We need to untabify lines before split()'ing them;
        # otherwise offsets would be invalid.
-       chomp $rem, $add;
+       chomp $rem;
+       chomp $add;
        $rem = untabify($rem);
        $add = untabify($add);
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]