From: Derrick Stolee <stolee@gmail.com>
To: Eugen Konkov <kes-kes@yandex.ru>, Git Mailing List <git@vger.kernel.org>
Subject: Re: [BUG] Bad coloring
Date: Wed, 26 Jun 2019 08:24:58 -0400 [thread overview]
Message-ID: <5e77e3ee-3daf-da00-fd81-323e34122004@gmail.com> (raw)
In-Reply-To: <1817947890.20190626113231@yandex.ru>
On 6/26/2019 4:32 AM, Eugen Konkov wrote:
> Hello,
>
> For next diff the `}` line should not be detected as removed/added.
>
> As you can see there are differences only at new lines. (see attached
> pics)
>
> git version 2.21.0
>
>
> git diff -b -w --ignore-blank-lines
>
>
> git config:
>
> [color "diff"]
> old = red bold
> new = green bold
>
> [diff]
> tool = sublimerge
> colorMoved = default
> colorMovedWS = ignore-all-space
>
Below, I pasted your diff in the message body for
easier discussion on-list.
Your diff shows that the content was moved. However, it was
also changed during the move by adding that extra line of
whitespace. The "ignore-all-space" setting can only ignore
whitespace when matching lines. It cannot ignore entire
lines of whitespace.
For that reason, the last three lines are not matched as moved
because they are not part of the larger hunk that moved. You
are using the 'default' mode for diff.colorMoved which defaults
to the 'zebra' mode and that matches blocks of at least 20
characters. These lines at the end are only four characters
("}\n\n\n").
If we used a smaller block size, then we would have too many
false-positives when using the color-moved option.
Thanks,
-Stolee
---
--- a/Service.pm
+++ b/Service.pm
@@ -34,46 +34,4 @@ $X->set_primary_key("id");
$X->has_many( service_types => $X, 'parent_id' );
-sub sqlt_deploy_hook {
- my( $self, $sqlt_table ) = @_;
-
- my $sqlt = $sqlt_table->schema;
- $sqlt->add_procedure(
- name => 'service_level_tree',
- parameters => [
- { argmode => 'in', type => 'integer' },
- ],
- extra => {
- returns => { type => 'table( id int, parent_id int, name text, display text,
- definitions => [
- { language => 'sql' },
- { attribute => 'STABLE' },
- { quote => "\$\$\n", body => <<' FUNC' =~ s!^\t!!grm =~ s!;\n!;/**/\n
- WITH RECURSIVE service_level_tree (id, parent_id, name, display, depth ) AS (
- SELECT
- id,
- parent_id,
- name,
- display,
- 1
- FROM service_level
- WHERE id = $1
- UNION
- SELECT
- sl.id,
- sl.parent_id,
- sl.name,
- sl.display,
- depth +1
- FROM service_level_tree t
- INNER JOIN service_level sl ON sl.id = t.parent_id
- WHERE depth < 10 -- Prohibit deep hierarchy
- )
- SELECT * FROM service_level_tree;
- FUNC
- ]});
-
-}
-
-
1;
diff --git a/ServiceLevel.pm b/S
index 73fa9dea..f7da48c8 100644
--- a/ServiceLevel.pm
+++ b/ServiceLevel.pm
@@ -34,4 +34,46 @@ $X->add_unique_constraint([ 'parent_id', 'name' ]);
$X->has_many( service_levels => $X, 'parent_id' );
+
+sub sqlt_deploy_hook {
+ my( $self, $sqlt_table ) = @_;
+
+ my $sqlt = $sqlt_table->schema;
+ $sqlt->add_procedure(
+ name => 'service_level_tree',
+ parameters => [
+ { argmode => 'in', type => 'integer' },
+ ],
+ extra => {
+ returns => { type => 'table( id int, parent_id int, name text, display text,
+ definitions => [
+ { language => 'sql' },
+ { attribute => 'STABLE' },
+ { quote => "\$\$\n", body => <<' FUNC' =~ s!^\t!!grm =~ s!;\n!;/**/\n
+ WITH RECURSIVE service_level_tree (id, parent_id, name, display, depth ) AS (
+ SELECT
+ id,
+ parent_id,
+ name,
+ display,
+ 1
+ FROM service_level
+ WHERE id = $1
+ UNION
+ SELECT
+ sl.id,
+ sl.parent_id,
+ sl.name,
+ sl.display,
+ depth +1
+ FROM service_level_tree t
+ INNER JOIN service_level sl ON sl.id = t.parent_id
+ WHERE depth < 10 -- Prohibit deep hierarchy
+ )
+ SELECT * FROM service_level_tree;
+ FUNC
+ ]});
+}
+
+
1;
prev parent reply other threads:[~2019-06-26 12:25 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-26 8:32 [BUG] Bad coloring Eugen Konkov
2019-06-26 12:24 ` Derrick Stolee [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5e77e3ee-3daf-da00-fd81-323e34122004@gmail.com \
--to=stolee@gmail.com \
--cc=git@vger.kernel.org \
--cc=kes-kes@yandex.ru \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).