Re: [PATCH 1/1] diff-highlight: fix a whitespace nit

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

 



On Tue, Oct 15, 2019 at 03:31:26AM +0000, Norman Rasmussen via GitGitGadget wrote:

> From: Norman Rasmussen <norman@xxxxxxxxxxxxxxx>
> 
> This changes the indent from
>   "<tab><sp><sp><sp><sp><sp><sp><sp><sp>"
> to
>   "<tab><tab>"
> so that the statement lines up with the rest of the block.

Yep, that makes sense. Looks like I introduced the problem (most of my
perl used to be written in a style that forbids tabs, so it may have
snuck in that way, but the rest of the file definitely follows Git's
usual style of tabs).

> diff --git a/contrib/diff-highlight/DiffHighlight.pm b/contrib/diff-highlight/DiffHighlight.pm
> index 7440aa1c46..e2589922a6 100644
> --- a/contrib/diff-highlight/DiffHighlight.pm
> +++ b/contrib/diff-highlight/DiffHighlight.pm
> @@ -72,7 +72,7 @@ sub handle_line {
>  	      (?:$COLOR?\|$COLOR?[ ])* # zero or more trailing "|"
>  	                         [ ]*  # trailing whitespace for merges
>  	    /x) {
> -	        my $graph_prefix = $&;
> +		my $graph_prefix = $&;

There are a few lines just above that have 8+ spaces. Arguably those
could be tabs, too, depending on your view of tabs. We usually do "8
spaces is a tab" in the Git project, but the oft-repeated "tabs to
indent, spaces to align" mantra would apply here (and I suspect you're
using a different tabwidth since you noticed this one case). So I'd just
as soon leave them be, and take your patch as-is.

-Peff



[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]

  Powered by Linux