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

Re: [PATCH v3 0/9] icase match on non-ascii

From
Torsten Bögershausen <tboegi@web.de>
Date
Jul 14, 2015, 16:42 UTC
Message-ID
<55A53C13.5090405@web.de>
In-Reply-To
<1436880280-18194-1-git-send-email-pclouds@gmail.com>

(I haven't been able to do more debugging yet, but this doesn't fully work on my Mac OS X box:)

Initialized empty Git repository in
/Users/tb/NoBackup/projects/git/tb.150714_Duy_grep_utf8/t/trash
directory.t7812-grep-icase-non-ascii/.git/
# lib-gettext: Found 'is_IS.UTF-8' as an is_IS UTF-8 locale
# lib-gettext: Found 'is_IS.ISO8859-1' as an is_IS ISO-8859-1 locale
expecting success:
    printf "TILRAUN: Halló Heimur!" >file &&
    git add file &&
    LC_ALL="$is_IS_locale" &&
    export LC_ALL
ok 1 - setup
expecting success:
    git grep -i "TILRAUN: Halló Heimur!" &&
    git grep -i "TILRAUN: HALLÓ HEIMUR!"

file:TILRAUN: Halló Heimur! not ok 2 - grep literal string, no -F # # git grep -i "TILRAUN: Halló Heimur!" && # git grep -i "TILRAUN: HALLÓ HEIMUR!" #

skipping test: grep pcre utf-8 icase
    git grep --perl-regexp    "TILRAUN: H.lló Heimur!" &&
    git grep --perl-regexp -i "TILRAUN: H.lló Heimur!" &&
    git grep --perl-regexp -i "TILRAUN: H.LLÓ HEIMUR!"
ok 3 # skip grep pcre utf-8 icase (missing LIBPCRE of GETTEXT_LOCALE,LIBPCRE)
skipping test: grep pcre utf-8 string with "+"
    printf "TILRAUN: Hallóó Heimur!" >file2 &&
    git add file2 &&
    git grep -l --perl-regexp "TILRAUN: H.lló+ Heimur!" >actual &&
    echo file >expected &&
    echo file2 >>expected &&
    test_cmp expected actual

ok 4 # skip grep pcre utf-8 string with "+" (missing LIBPCRE of GETTEXT_LOCALE,LIBPCRE)

expecting success:
    git grep --debug -i -F "TILRAUN: Halló Heimur!"  2>&1 >/dev/null |
         grep fixed >debug1 &&
    echo "fixedTILRAUN: Halló Heimur!" >expect1 &&
    test_cmp expect1 debug1 &&
    git grep --debug -i -F "TILRAUN: HALLÓ HEIMUR!"  2>&1 >/dev/null |
         grep fixed >debug2 &&
    echo "fixedTILRAUN: HALLÓ HEIMUR!" >expect2 &&
    test_cmp expect2 debug2
ok 5 - grep literal string, with -F
expecting success:
    printf "^*TILR^AUN:.* \\Halló \$He[]imur!\$" >file &&
    git grep --debug -i -F "^*TILR^AUN:.* \\Halló \$He[]imur!\$" 2>&1 >/dev/null |
         grep fixed >debug1 &&
    echo "fixed\\^*TILR^AUN:\\.\\* \\\\Halló \$He\\[]imur!\\\$" >expect1 &&
    test_cmp expect1 debug1 &&
    git grep --debug -i -F "^*TILR^AUN:.* \\HALLÓ \$HE[]IMUR!\$"  2>&1 >/dev/null |
         grep fixed >debug2 &&
    echo "fixed\\^*TILR^AUN:\\.\\* \\\\HALLÓ \$HE\\[]IMUR!\\\$" >expect2 &&
    test_cmp expect2 debug2

--- expect1 2015-07-14 16:38:22.000000000 +0000 +++ debug1 2015-07-14 16:38:22.000000000 +0000

@@ -1 +1 @@
-fixed\^*TILR^AUN:\.\* \Halló $He\[]imur!\$
+fixed\^*TILR^AUN:\.\* \\Halló $He\[]imur!\$
not ok 6 - grep string with regex, with -F
#   
#        printf "^*TILR^AUN:.* \\Halló \$He[]imur!\$" >file &&
#   
#        git grep --debug -i -F "^*TILR^AUN:.* \\Halló \$He[]imur!\$" 2>&1
>/dev/null |
#             grep fixed >debug1 &&
#        echo "fixed\\^*TILR^AUN:\\.\\* \\\\Halló \$He\\[]imur!\\\$" >expect1 &&
#        test_cmp expect1 debug1 &&
#   
#        git grep --debug -i -F "^*TILR^AUN:.* \\HALLÓ \$HE[]IMUR!\$"  2>&1
>/dev/null |
#             grep fixed >debug2 &&
#        echo "fixed\\^*TILR^AUN:\\.\\* \\\\HALLÓ \$HE\\[]IMUR!\\\$" >expect2 &&
#        test_cmp expect2 debug2
#   

expecting success:
    git commit -m first &&
    git log --format=%f -i -S"TILRAUN: HALLÓ HEIMUR!" >actual &&
    echo first >expected &&
    test_cmp expected actual

[master (root-commit) e6052d5] first
 Author: A U Thor <author@example.com>
 1 file changed, 1 insertion(+)
 create mode 100644 file
--- expected    2015-07-14 16:38:22.000000000 +0000
+++ actual    2015-07-14 16:38:22.000000000 +0000
@@ -1 +0,0 @@
-first
not ok 7 - pickaxe -i on non-ascii
#   
#        git commit -m first &&
#        git log --format=%f -i -S"TILRAUN: HALLÓ HEIMUR!" >actual &&
#        echo first >expected &&
#        test_cmp expected actual
#   

# failed 3 among 7 test(s)
1..7
Previous: Nguyễn Thái Ngọc DuyNext: Duy Nguyen
Message 40 of 53 in “Git grep does not support multi-byte characters (like UTF-8)”
  1. Plamen TotevJul 6, 2015
  2. Duy NguyenJul 6, 2015
  3. Plamen TotevJul 7, 2015
  4. Duy NguyenJul 7, 2015
  5. Junio C HamanoJul 7, 2015
  6. Plamen TotevJul 7, 2015
  7. Duy NguyenJul 8, 2015
  8. Junio C HamanoJul 8, 2015
  9. grep: use regcomp() for icase search with non-ascii patternsNguyễn Thái Ngọc Duy, Jul 6, 2015
  10. René ScharfeJul 6, 2015
  11. Duy NguyenJul 6, 2015
  12. Plamen TotevJul 7, 2015
  13. 0/9 icase match on non-asciiNguyễn Thái Ngọc Duy, Jul 8, 2015
  14. 1/9 grep: allow -F -i combinationNguyễn Thái Ngọc Duy, Jul 8, 2015
  15. 2/9 grep: break down an "if" stmt in preparation for next changesNguyễn Thái Ngọc Duy, Jul 8, 2015
  16. 3/9 grep/icase: avoid kwsset on literal non-ascii stringsNguyễn Thái Ngọc Duy, Jul 8, 2015
  17. 4/9 grep/icase: avoid kwsset when -F is specifiedNguyễn Thái Ngọc Duy, Jul 8, 2015
  18. 5/9 grep/pcre: prepare locale-dependent tables for icase matchingNguyễn Thái Ngọc Duy, Jul 8, 2015
  19. Duy NguyenJul 8, 2015
  20. 6/9 gettext: add is_utf8_locale()Nguyễn Thái Ngọc Duy, Jul 8, 2015
  21. 7/9 grep/pcre: support utf-8Nguyễn Thái Ngọc Duy, Jul 8, 2015
  22. Plamen TotevJul 11, 2015
  23. 8/9 diffcore-pickaxe: "share" regex error handling codeNguyễn Thái Ngọc Duy, Jul 8, 2015
  24. 9/9 diffcore-pickaxe: support case insensitive match on non-asciiNguyễn Thái Ngọc Duy, Jul 8, 2015
  25. Eric SunshineJul 9, 2015
  26. Torsten BögershausenJul 8, 2015
  27. Duy NguyenJul 8, 2015
  28. Junio C HamanoJul 8, 2015
  29. Duy NguyenJul 8, 2015
  30. 0/9 icase match on non-asciiNguyễn Thái Ngọc Duy, Jul 14, 2015
  31. 1/9 grep: allow -F -i combinationNguyễn Thái Ngọc Duy, Jul 14, 2015
  32. 2/9 grep: break down an "if" stmt in preparation for next changesNguyễn Thái Ngọc Duy, Jul 14, 2015
  33. 3/9 grep/icase: avoid kwsset on literal non-ascii stringsNguyễn Thái Ngọc Duy, Jul 14, 2015
  34. 4/9 grep/icase: avoid kwsset when -F is specifiedNguyễn Thái Ngọc Duy, Jul 14, 2015
  35. 5/9 grep/pcre: prepare locale-dependent tables for icase matchingNguyễn Thái Ngọc Duy, Jul 14, 2015
  36. 6/9 gettext: add is_utf8_locale()Nguyễn Thái Ngọc Duy, Jul 14, 2015
  37. 7/9 grep/pcre: support utf-8Nguyễn Thái Ngọc Duy, Jul 14, 2015
  38. 8/9 diffcore-pickaxe: "share" regex error handling codeNguyễn Thái Ngọc Duy, Jul 14, 2015
  39. 9/9 diffcore-pickaxe: support case insensitive match on non-asciiNguyễn Thái Ngọc Duy, Jul 14, 2015
  40. Torsten BögershausenJul 14, 2015
  41. Duy NguyenJul 15, 2015
  42. Torsten BögershausenJul 15, 2015
  43. 00/10 icase match on non-asciiNguyễn Thái Ngọc Duy, Aug 21, 2015
  44. 01/10 grep: allow -F -i combinationNguyễn Thái Ngọc Duy, Aug 21, 2015
  45. 02/10 grep: break down an "if" stmt in preparation for next changesNguyễn Thái Ngọc Duy, Aug 21, 2015
  46. 03/10 test-regex: expose full regcomp() to the command lineNguyễn Thái Ngọc Duy, Aug 21, 2015
  47. 04/10 grep/icase: avoid kwsset on literal non-ascii stringsNguyễn Thái Ngọc Duy, Aug 21, 2015
  48. 05/10 grep/icase: avoid kwsset when -F is specifiedNguyễn Thái Ngọc Duy, Aug 21, 2015
  49. 06/10 grep/pcre: prepare locale-dependent tables for icase matchingNguyễn Thái Ngọc Duy, Aug 21, 2015
  50. 07/10 gettext: add is_utf8_locale()Nguyễn Thái Ngọc Duy, Aug 21, 2015
  51. 08/10 grep/pcre: support utf-8Nguyễn Thái Ngọc Duy, Aug 21, 2015
  52. 09/10 diffcore-pickaxe: "share" regex error handling codeNguyễn Thái Ngọc Duy, Aug 21, 2015
  53. 10/10 diffcore-pickaxe: support case insensitive match on non-asciiNguyễn Thái Ngọc Duy, Aug 21, 2015

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.