{"thread":{"id":"29949","subject":"[PATCH] Demonstrate a bug in --word-diff where diff.*.wordregex is \"sticky\"","startedAt":"2012-03-14T16:39:38Z","lastAt":"2012-03-14T16:39:38Z","messageCount":1,"participants":["Johannes Sixt"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"186959","messageId":"4F60C9CA.1040109@viscovery.net","threadId":"29949","inReplyTo":null,"subject":"[PATCH] Demonstrate a bug in --word-diff where diff.*.wordregex is \"sticky\"","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2012-03-14T16:39:38Z","receivedAt":"2012-03-14T16:39:38Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"From: Johannes Sixt <j6t@kdbg.org>\n\nThe test case applies a custom wordRegex to one file in a diff, and expects\nthat the default word splitting applies to the second file in the diff.\nBut the custom wordRegex is also incorrectly used for the second file.\n\nSigned-off-by: Johannes Sixt <j6t@kdbg.org>\n---\n What's going on here?\n\n t/t4034-diff-words.sh |   33 +++++++++++++++++++++++++++++++++\n 1 files changed, 33 insertions(+), 0 deletions(-)\n\ndiff --git a/t/t4034-diff-words.sh b/t/t4034-diff-words.sh\nindex 5c20121..1ad7ab5 100755\n--- a/t/t4034-diff-words.sh\n+++ b/t/t4034-diff-words.sh\n@@ -348,4 +348,37 @@ test_expect_success 'word-diff with no newline at EOF' '\n \tword_diff --word-diff=plain\n '\n \n+test_expect_success 'setup history with two files' '\n+\techo \"a b; c\" >a &&\n+\techo \"a b; c\" >z &&\n+\tgit add a z &&\n+\tgit commit -minitial &&\n+\n+\t# modify both\n+\techo \"a bx; c\" >a &&\n+\techo \"a bx; c\" >z &&\n+\tgit commit -mmodified -a\n+'\n+\n+test_expect_failure 'wordRegex for the first file does not apply to the second' '\n+\techo \"a diff=tex\" >.gitattributes &&\n+\tgit config diff.tex.wordRegex \"[a-z]+|.\" &&\n+\tcat >expect <<-\\EOF &&\n+\t\tdiff --git a/a b/a\n+\t\tindex 9823d38..b09f967 100644\n+\t\t--- a/a\n+\t\t+++ b/a\n+\t\t@@ -1 +1 @@\n+\t\ta [-b-]{+bx+}; c\n+\t\tdiff --git a/z b/z\n+\t\tindex 9823d38..b09f967 100644\n+\t\t--- a/z\n+\t\t+++ b/z\n+\t\t@@ -1 +1 @@\n+\t\ta [-b;-]{+bx;+} c\n+\tEOF\n+\tgit diff --word-diff HEAD~ >actual\n+\ttest_cmp expect actual\n+'\n+\n test_done\n-- \n1.7.9.rc2.96.g8a78a\n"}]}