git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] grep: add known breakage of coloring when using extended patterns

From
Bert Wesarg <bert.wesarg@googlemail.com>
Date
May 2, 2011, 11:35 UTC
Message-ID
<328649cbd9fe7f2ee5f43d1e860d712f4204bdc5.1304333975.git.bert.wesarg@googlemail.com>

The coloring code does not respect the extended pattern format, expose this with an known breakage test.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
---
 t/t7812-grep-color.sh |   25 +++++++++++++++++++++++++
 1 files changed, 25 insertions(+), 0 deletions(-)
 create mode 100755 t/t7812-grep-color.sh
diff --git a/t/t7812-grep-color.sh b/t/t7812-grep-color.sh
new file mode 100755
index 0000000..2cffff3
--- /dev/null
+++ b/t/t7812-grep-color.sh
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+test_description='git grep --color
+'
+
+. ./test-lib.sh
+
+test_expect_success 'setup' '
+	test_commit initial input "foo bar baz
+bar baz
+"
+'
+
+cat >expected <<EOF
+input<CYAN>:<RESET><BOLD;RED>foo<RESET> bar baz
+EOF
+
+
+test_expect_failure 'grep coloring does not honor boolean algebra' '
+	git grep --color -e foo --or \( -e bar --and --not -e baz \) |
+		test_decode_color >actual
+    test_cmp expected actual
+'
+
+test_done
-- 
1.7.5.349.gfeb1a
Next: Johannes Sixt
Message 1 of 8 in “grep: add known breakage of coloring when using extended patterns”
  1. grep: add known breakage of coloring when using extended patternsBert Wesarg, May 2, 2011
  2. Johannes SixtMay 2, 2011
  3. Bert WesargMay 2, 2011
  4. René ScharfeMay 2, 2011
  5. Junio C HamanoMay 2, 2011
  6. René ScharfeMay 2, 2011
  7. Junio C HamanoMay 2, 2011
  8. René ScharfeMay 3, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.