{"thread":{"id":"51382","subject":"[BUG] Bad coloring","startedAt":"2019-06-26T08:38:11Z","lastAt":"2019-06-26T12:25:03Z","messageCount":2,"participants":["Eugen Konkov","Derrick Stolee"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"378055","messageId":"1817947890.20190626113231@yandex.ru","threadId":"51382","inReplyTo":null,"subject":"[BUG] Bad coloring","fromName":"Eugen Konkov","fromEmail":"kes-kes@yandex.ru","sentAt":"2019-06-26T08:32:31Z","receivedAt":"2019-06-26T08:38:11Z","isPatch":false,"sender":{"key":"kes-kes@yandex.ru","avatar":null},"body":"Hello,\n\nFor next diff the `}` line should not be detected as removed/added.\n\nAs  you can see there are differences only at new lines. (see attached\npics)\n\ngit version 2.21.0\n\n\ngit diff -b -w --ignore-blank-lines\n\n\ngit config:\n\n[color \"diff\"]\n    old = red bold\n    new = green bold\n\n[diff]\n    tool = sublimerge\n    colorMoved = default\n    colorMovedWS = ignore-all-space\n\n\n\n-- \nBest regards,\nEugen Konkov"},{"id":"378060","messageId":"5e77e3ee-3daf-da00-fd81-323e34122004@gmail.com","threadId":"51382","inReplyTo":"1817947890.20190626113231@yandex.ru","subject":"Re: [BUG] Bad coloring","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2019-06-26T12:24:58Z","receivedAt":"2019-06-26T12:25:03Z","isPatch":false,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"On 6/26/2019 4:32 AM, Eugen Konkov wrote:\n> Hello,\n> \n> For next diff the `}` line should not be detected as removed/added.\n> \n> As  you can see there are differences only at new lines. (see attached\n> pics)\n> \n> git version 2.21.0\n> \n> \n> git diff -b -w --ignore-blank-lines\n> \n> \n> git config:\n> \n> [color \"diff\"]\n>     old = red bold\n>     new = green bold\n> \n> [diff]\n>     tool = sublimerge\n>     colorMoved = default\n>     colorMovedWS = ignore-all-space\n> \n\nBelow, I pasted your diff in the message body for\neasier discussion on-list.\n\nYour diff shows that the content was moved. However, it was\nalso changed during the move by adding that extra line of\nwhitespace. The \"ignore-all-space\" setting can only ignore\nwhitespace when matching lines. It cannot ignore entire\nlines of whitespace.\n\nFor that reason, the last three lines are not matched as moved\nbecause they are not part of the larger hunk that moved. You\nare using the 'default' mode for diff.colorMoved which defaults\nto the 'zebra' mode and that matches blocks of at least 20\ncharacters. These lines at the end are only four characters\n(\"}\\n\\n\\n\").\n\nIf we used a smaller block size, then we would have too many\nfalse-positives when using the color-moved option.\n\nThanks,\n-Stolee\n\n---\n\n--- a/Service.pm\n+++ b/Service.pm\n@@ -34,46 +34,4 @@ $X->set_primary_key(\"id\");\n $X->has_many( service_types => $X, 'parent_id' );\n \n \n-sub sqlt_deploy_hook {\n-    my( $self, $sqlt_table ) =  @_;\n-\n-    my $sqlt =  $sqlt_table->schema;\n-    $sqlt->add_procedure(\n-        name =>  'service_level_tree',\n-        parameters =>  [\n-            { argmode => 'in',  type => 'integer' },\n-        ],\n-        extra =>  {\n-            returns =>  { type => 'table( id int, parent_id int, name text, display text,\n-            definitions =>  [\n-                { language  =>  'sql' },\n-                { attribute =>  'STABLE' },\n-                { quote => \"\\$\\$\\n\",  body => <<'   FUNC' =~ s!^\\t!!grm  =~ s!;\\n!;/**/\\n\n-        WITH RECURSIVE service_level_tree (id, parent_id, name, display, depth ) AS (\n-            SELECT\n-              id,\n-              parent_id,\n-              name,\n-              display,\n-              1\n-            FROM service_level\n-            WHERE id = $1\n-            UNION\n-            SELECT\n-              sl.id,\n-              sl.parent_id,\n-              sl.name,\n-              sl.display,\n-              depth +1\n-            FROM service_level_tree t\n-            INNER JOIN service_level sl ON sl.id = t.parent_id\n-            WHERE depth < 10   -- Prohibit deep hierarchy\n-        )\n-        SELECT * FROM service_level_tree;\n-    FUNC\n-    ]});\n-\n-}\n-\n-\n 1;\ndiff --git a/ServiceLevel.pm b/S\nindex 73fa9dea..f7da48c8 100644\n--- a/ServiceLevel.pm\n+++ b/ServiceLevel.pm\n@@ -34,4 +34,46 @@ $X->add_unique_constraint([ 'parent_id', 'name' ]);\n \n $X->has_many( service_levels => $X, 'parent_id' );\n \n+\n+sub sqlt_deploy_hook {\n+    my( $self, $sqlt_table ) =  @_;\n+\n+    my $sqlt =  $sqlt_table->schema;\n+    $sqlt->add_procedure(\n+        name =>  'service_level_tree',\n+        parameters =>  [\n+            { argmode => 'in',  type => 'integer' },\n+        ],\n+        extra =>  {\n+            returns =>  { type => 'table( id int, parent_id int, name text, display text,\n+            definitions =>  [\n+                { language  =>  'sql' },\n+                { attribute =>  'STABLE' },\n+                { quote => \"\\$\\$\\n\",  body => <<'   FUNC' =~ s!^\\t!!grm  =~ s!;\\n!;/**/\\n\n+        WITH RECURSIVE service_level_tree (id, parent_id, name, display, depth ) AS (\n+            SELECT\n+              id,\n+              parent_id,\n+              name,\n+              display,\n+              1\n+            FROM service_level\n+            WHERE id = $1\n+            UNION\n+            SELECT\n+              sl.id,\n+              sl.parent_id,\n+              sl.name,\n+              sl.display,\n+              depth +1\n+            FROM service_level_tree t\n+            INNER JOIN service_level sl ON sl.id = t.parent_id\n+            WHERE depth < 10   -- Prohibit deep hierarchy\n+        )\n+        SELECT * FROM service_level_tree;\n+    FUNC\n+    ]});\n+}\n+\n+\n 1;\n\n"}]}