{"thread":{"id":"44800","subject":"Test failures when Git is built with libpcre and grep is built without it","startedAt":"2017-01-01T05:06:48Z","lastAt":"2017-01-11T20:53:48Z","messageCount":12,"participants":["A. Wilcox","Torsten Bögershausen","Jeff King","Andreas Schwab","Szabolcs Nagy","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"308567","messageId":"58688C9F.4000605@adelielinux.org","threadId":"44800","inReplyTo":null,"subject":"Test failures when Git is built with libpcre and grep is built without it","fromName":"A. Wilcox","fromEmail":"awilfox@adelielinux.org","sentAt":"2017-01-01T04:59:11Z","receivedAt":"2017-01-01T05:06:48Z","isPatch":false,"sender":{"key":"awilfox@adelielinux.org","avatar":"https://gravatar.com/avatar/7dfeb1949d7201fcf186c1ef0d0d0664f667c03834d1630eb7d057e7d37c2266?d=mp&s=160"},"body":"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA256\n\nHello!\n\nI'm attempting to package Git for our new Linux distribution and I\nhave run in to a failure on our PowerPC builder while running the test\nsuite.\n\nThe PowerPC builder runs a tiny version of grep(1) that was not built\nwith PCRE.  As such, grep -P returns 2 and prints:\n\ngrep: support for the -P option is not compiled into this\n- --disable-perl-regexp binary\n\nHowever, our Git build *does* link against libpcre.  This causes a\ntests numbered 142 and 143 to fail in t7810-grep.sh.\n\nI am not sure the best way to handle this but I felt it would be\nprudent to inform you of this issue.  I will be happy to provide any\nother information you may require.\n\nBest,\narw\n\n- -- \nA. Wilcox (awilfox)\nProject Lead, Adélie Linux\nhttp://adelielinux.org\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v2\n\niQIcBAEBCAAGBQJYaIycAAoJEMspy1GSK50U/g4P/AtPRfeOv8pENfI/PnlhXqSD\nC28CR0Hzv4qBv/Ay8vpBfmkM177bBnra5GTcfnAZ0wvxJUiqnkluu+EJ2UWfPNse\nr5ZbDkXCp42oek+vIi7jYi7UsyNqwyT1DziYLR5PDopT3L8YK7i9pZCQZ+mDSmVT\nIu3gYmLvyyEL7r104o6ACRw11P5CDL9bKFmSVacD9UvPL3EjOM9LrSdRDzvJmk0u\nnqAOH6yw4wknxCWGPA3JT4DM9GD5DB/Y+UmVQrrpA+Txl8gbPjgzb1PX4qogHjNq\ndNDk1jeKJd/CmwJdAU6eKQ3bgfnIXzLbTDVmaMTMlUUsHzlqE/7QYnrae76ECmmn\ndrmezgKRwTtVgQjQ8l/F/c+EQhux9c0zM9Lz+0Hrd7v1WwohLQDA0xYOE8cCaLw1\n8WmXQWjNG1Ih2GpAZH7CRreWyiDAiaAZI2d/zOhsgG9edNEmNn+LkesajVdMywUJ\njKlxmKk6qK2uPDPVrD261ODtMxVdptG6/+m24iz56WRERWkkFBpZz15OtrtlLa2E\n0LcFiu2f5lki12XDZsSJwkLeGfb6KyxfCPKtGP7TAVAYO43ORQHKhks8pheOMwJa\ndpL4+72CzkI57LyCtl0NiSMZH2zKUvxp8OqKgE/gpDwbhwh8spAHdUaiaS6emiPj\nMM6jb7ru9eo4gD6seRCp\n=R9eQ\n-----END PGP SIGNATURE-----\n"},{"id":"308574","messageId":"38525b2e-2a5f-941f-2eca-912632f9a2ec@web.de","threadId":"44800","inReplyTo":"58688C9F.4000605@adelielinux.org","subject":"Re: Test failures when Git is built with libpcre and grep is built without it","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2017-01-01T10:19:51Z","receivedAt":"2017-01-01T10:20:15Z","isPatch":false,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 01.01.17 05:59, A. Wilcox wrote:\n> -----BEGIN PGP SIGNED MESSAGE-----\n> Hash: SHA256\n> \n> Hello!\n> \n> I'm attempting to package Git for our new Linux distribution and I\n> have run in to a failure on our PowerPC builder while running the test\n> suite.\n> \n> The PowerPC builder runs a tiny version of grep(1) that was not built\n> with PCRE.  As such, grep -P returns 2 and prints:\n> \n> grep: support for the -P option is not compiled into this\n> - --disable-perl-regexp binary\n> \n> However, our Git build *does* link against libpcre.  This causes a\n> tests numbered 142 and 143 to fail in t7810-grep.sh.\n> \n> I am not sure the best way to handle this but I felt it would be\n> prudent to inform you of this issue.  I will be happy to provide any\n> other information you may require.\n\nThe first thing you can do is to run the test with debug and verbose:\n\ndebug=t verbose=t ./t7810-grep.sh  \nand post the output of these 2 test cases here:\n(mine looks like this)\n\nexpecting success: \n\techo \"ab:a+bc\" >expected &&\n\tgit \\\n\t\t-c grep.patterntype=extended \\\n\t\t-c grep.patterntype=fixed \\\n\t\t-c grep.patterntype=basic \\\n\t\tgrep \"a+b*c\" ab >actual &&\n\ttest_cmp expected actual\n\nok 142 - grep pattern with grep.patternType=extended, =fixed, =basic\n\nexpecting success: \n\techo \"ab:abc\" >expected &&\n\tgit grep -F -G -E \"a+b*c\" ab >actual &&\n\ttest_cmp expected actual\n\nok 143 - grep -F -G -E pattern\n\n"},{"id":"308606","messageId":"20170102065351.7ymrm77asjbghgdg@sigill.intra.peff.net","threadId":"44800","inReplyTo":"58688C9F.4000605@adelielinux.org","subject":"Re: Test failures when Git is built with libpcre and grep is built without it","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2017-01-02T06:53:51Z","receivedAt":"2017-01-02T06:53:58Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Dec 31, 2016 at 10:59:11PM -0600, A. Wilcox wrote:\n\n> I'm attempting to package Git for our new Linux distribution and I\n> have run in to a failure on our PowerPC builder while running the test\n> suite.\n> \n> The PowerPC builder runs a tiny version of grep(1) that was not built\n> with PCRE.  As such, grep -P returns 2 and prints:\n> \n> grep: support for the -P option is not compiled into this\n> - --disable-perl-regexp binary\n> \n> However, our Git build *does* link against libpcre.  This causes a\n> tests numbered 142 and 143 to fail in t7810-grep.sh.\n\nIf we are using \"grep -P\" in our test suite, it should definitely be\nmarked with a prerequisite that is independent of the LIBPCRE one.\n\nBut I can't find any such place in our test suite. Grepping for\n\"grep.*-P\" doesn't turn up any hits, and dropping this into my PATH as\n\"grep\":\n\n    #!/bin/sh\n\n    case \"$*\" in\n    *-P*|*perl-regex*)\n      echo >&2 \"Pretending not to understand -P\"\n      exit 1\n    esac\n\n    exec /bin/grep \"$@\"\n\ndoesn't break anything. We do call \"git grep -P\", of course, but that\nshould be using the internal libpcre (once upon a time we would invoke\nan external grep, but that feature has been gone for years).\n\nCan you show us the output of \"./t7810-grep.sh -v -i\"?\n\n-Peff\n"},{"id":"309019","messageId":"58736B2A.40003@adelielinux.org","threadId":"44800","inReplyTo":"20170102065351.7ymrm77asjbghgdg@sigill.intra.peff.net","subject":"Re: Test failures when Git is built with libpcre and grep is built without it","fromName":"A. Wilcox","fromEmail":"awilfox@adelielinux.org","sentAt":"2017-01-09T10:51:22Z","receivedAt":"2017-01-09T10:54:48Z","isPatch":false,"sender":{"key":"awilfox@adelielinux.org","avatar":"https://gravatar.com/avatar/7dfeb1949d7201fcf186c1ef0d0d0664f667c03834d1630eb7d057e7d37c2266?d=mp&s=160"},"body":"On 02/01/17 00:53, Jeff King wrote:\n> On Sat, Dec 31, 2016 at 10:59:11PM -0600, A. Wilcox wrote:\n> \n>> I'm attempting to package Git for our new Linux distribution and\n>> I have run in to a failure on our PowerPC builder while running\n>> the test suite.\n>> \n>> The PowerPC builder runs a tiny version of grep(1) that was not\n>> built with PCRE.  As such, grep -P returns 2 and prints:\n>> \n>> grep: support for the -P option is not compiled into this -\n>> --disable-perl-regexp binary\n>> \n>> However, our Git build *does* link against libpcre.  This causes\n>> a tests numbered 142 and 143 to fail in t7810-grep.sh.\n> \n> If we are using \"grep -P\" in our test suite, it should definitely\n> be marked with a prerequisite that is independent of the LIBPCRE\n> one.\n> \n> But I can't find any such place in our test suite. [snip] Can you\n> show us the output of \"./t7810-grep.sh -v -i\"?\n> \n> -Peff\n> \n\nThe output of this command was almost 1400 lines, so I attached the log.\n\nInterestingly enough, you seem to be right.  The failure is very\nbizarre and has nothing to do with system /bin/grep:\n\ntest_must_fail: command succeeded: git grep -G -F -P -E a\\x{2b}b\\x{2a}c ab\nnot ok 142 - grep -G -F -P -E pattern\n#\n#               >empty &&\n#               test_must_fail git grep -G -F -P -E \"a\\x{2b}b\\x{2a}c\"\nab >actual &&\n#               test_cmp empty actual\n#\n\nHowever:\n\nelaine trash directory.t7810-grep # git grep -G -F -P -E\na\\x{2b}b\\x{2a}c ab >actual\nfatal: command line, 'ax{2b}bx{2a}c': Invalid contents of {}\nelaine trash directory.t7810-grep # echo $?\n128\nelaine trash directory.t7810-grep # cat actual\nelaine trash directory.t7810-grep #\n\n\nI can reliably reproduce this on our x86_64 builder as well.  Note\nthat our distro is based on the musl libc, not glibc.  The shell is:\n\nGNU bash, version 4.3.48(1)-release (powerpc-foxkit-linux-musl)\n\nlrwxrwxrwx 1 root root 4 Dec 29 10:43 /bin/sh -> /bin/bash\n\nAny further assistance would be greatly appreciated; this one really\nhas me stumped.\n\nBest,\n-arw\n\n\n-- \nA. Wilcox (awilfox)\nProject Lead, Adélie Linux\nhttp://adelielinux.org\n\n\nelaine t # ./t7810-grep.sh -v -i\nInitialized empty Git repository in /usr/src/dev-vcs/git-2.7.3-r1/work/git-2.7.3/t/trash directory.t7810-grep/.git/\nexpecting success: \n        {\n                echo foo mmap bar\n                echo foo_mmap bar\n                echo foo_mmap bar mmap\n                echo foo mmap bar_mmap\n                echo foo_mmap bar mmap baz\n        } >file &&\n        {\n                echo Hello world\n                echo HeLLo world\n                echo Hello_world\n                echo HeLLo_world\n        } >hello_world &&\n        {\n                echo \"a+b*c\"\n                echo \"a+bc\"\n                echo \"abc\"\n        } >ab &&\n        echo vvv >v &&\n        echo ww w >w &&\n        echo x x xx x >x &&\n        echo y yy >y &&\n        echo zzz > z &&\n        mkdir t &&\n        echo test >t/t &&\n        echo vvv >t/v &&\n        mkdir t/a &&\n        echo vvv >t/a/v &&\n        {\n                echo \"line without leading space1\"\n                echo \" line with leading space1\"\n                echo \" line with leading space2\"\n                echo \" line with leading space3\"\n                echo \"line without leading space2\"\n        } >space &&\n        git add . &&\n        test_tick &&\n        git commit -m initial\n\n[master (root-commit) cfd9fd5] initial\n Author: A U Thor <author@example.com>\n 13 files changed, 32 insertions(+)\n create mode 100644 ab\n create mode 100644 file\n create mode 100644 hello.c\n create mode 100644 hello_world\n create mode 100644 space\n create mode 100644 t/a/v\n create mode 100644 t/t\n create mode 100644 t/v\n create mode 100644 v\n create mode 100644 w\n create mode 100644 x\n create mode 100644 y\n create mode 100644 z\nok 1 - setup\n\nexpecting success: \n        test_must_fail git grep \"(\"\n\nfatal: unmatched parenthesis\nok 2 - grep should not segfault with a bad input\n\nexpecting success: \n                {\n                        echo ${HC}file:1:foo mmap bar\n                        echo ${HC}file:3:foo_mmap bar mmap\n                        echo ${HC}file:4:foo mmap bar_mmap\n                        echo ${HC}file:5:foo_mmap bar mmap baz\n                } >expected &&\n                git -c grep.linenumber=false grep -n -w -e mmap $H >actual &&\n                test_cmp expected actual\n\nok 3 - grep -w HEAD\n\nexpecting success: \n                {\n                        echo ${HC}file:1:foo mmap bar\n                        echo ${HC}file:3:foo_mmap bar mmap\n                        echo ${HC}file:4:foo mmap bar_mmap\n                        echo ${HC}file:5:foo_mmap bar mmap baz\n                } >expected &&\n                git -c grep.linenumber=true grep -w -e mmap $H >actual &&\n                test_cmp expected actual\n\nok 4 - grep -w HEAD\n\nexpecting success: \n                {\n                        echo ${HC}file:foo mmap bar\n                        echo ${HC}file:foo_mmap bar mmap\n                        echo ${HC}file:foo mmap bar_mmap\n                        echo ${HC}file:foo_mmap bar mmap baz\n                } >expected &&\n                git -c grep.linenumber=true grep --no-line-number -w -e mmap $H >actual &&\n                test_cmp expected actual\n\nok 5 - grep -w HEAD\n\nexpecting success: \n                : >expected &&\n                test_must_fail git grep -n -w -e \"^w\" $H >actual &&\n                test_cmp expected actual\n\nok 6 - grep -w HEAD (w)\n\nexpecting success: \n                {\n                        echo ${HC}x:1:x x xx x\n                } >expected &&\n                git grep -n -w -e \"x xx* x\" $H >actual &&\n                test_cmp expected actual\n\nok 7 - grep -w HEAD (x)\n\nexpecting success: \n                {\n                        echo ${HC}y:1:y yy\n                } >expected &&\n                git grep -n -w -e \"^y\" $H >actual &&\n                test_cmp expected actual\n\nok 8 - grep -w HEAD (y-1)\n\nexpecting success: \n                : >expected &&\n                if git grep -n -w -e \"^y y\" $H >actual\n                then\n                        echo should not have matched\n                        cat actual\n                        false\n                else\n                        test_cmp expected actual\n                fi\n\nok 9 - grep -w HEAD (y-2)\n\nexpecting success: \n                : >expected &&\n                if git grep -n -w -e \"^z\" $H >actual\n                then\n                        echo should not have matched\n                        cat actual\n                        false\n                else\n                        test_cmp expected actual\n                fi\n\nok 10 - grep -w HEAD (z)\n\nexpecting success: \n                echo \"${HC}t/t:1:test\" >expected &&\n                git grep -n -e test $H >actual &&\n                test_cmp expected actual\n\nok 11 - grep HEAD (t-1)\n\nexpecting success: \n                echo \"${HC}t:1:test\" >expected &&\n                (\n                        cd t &&\n                        git grep -n -e test $H\n                ) >actual &&\n                test_cmp expected actual\n\nok 12 - grep HEAD (t-2)\n\nexpecting success: \n                echo \"${HC}t/t:1:test\" >expected &&\n                (\n                        cd t &&\n                        git grep --full-name -n -e test $H\n                ) >actual &&\n                test_cmp expected actual\n\nok 13 - grep HEAD (t-3)\n\nexpecting success: \n                ! git grep -c test $H | grep /dev/null\n        \nok 14 - grep -c HEAD (no /dev/null)\n\nexpecting success: \n                {\n                        echo ${HC}t/a/v:1:vvv\n                        echo ${HC}t/v:1:vvv\n                        echo ${HC}v:1:vvv\n                } >expected &&\n                git grep --max-depth -1 -n -e vvv $H >actual &&\n                test_cmp expected actual\n\nok 15 - grep --max-depth -1 HEAD\n\nexpecting success: \n                {\n                        echo ${HC}v:1:vvv\n                } >expected &&\n                git grep --max-depth 0 -n -e vvv $H >actual &&\n                test_cmp expected actual\n\nok 16 - grep --max-depth 0 HEAD\n\nexpecting success: \n                {\n                        echo ${HC}t/a/v:1:vvv\n                        echo ${HC}t/v:1:vvv\n                        echo ${HC}v:1:vvv\n                } >expected &&\n                git grep --max-depth 0 -n -e vvv $H -- \"*\" >actual &&\n                test_cmp expected actual\n\nok 17 - grep --max-depth 0 -- '*' HEAD\n\nexpecting success: \n                {\n                        echo ${HC}t/v:1:vvv\n                        echo ${HC}v:1:vvv\n                } >expected &&\n                git grep --max-depth 1 -n -e vvv $H >actual &&\n                test_cmp expected actual\n\nok 18 - grep --max-depth 1 HEAD\n\nexpecting success: \n                {\n                        echo ${HC}t/v:1:vvv\n                } >expected &&\n                git grep --max-depth 0 -n -e vvv $H -- t >actual &&\n                test_cmp expected actual\n\nok 19 - grep --max-depth 0 -- t HEAD\n\nexpecting success: \n                {\n                        echo ${HC}t/v:1:vvv\n                        echo ${HC}v:1:vvv\n                } >expected &&\n                git grep --max-depth 0 -n -e vvv $H -- . t >actual &&\n                test_cmp expected actual\n\nok 20 - grep --max-depth 0 -- . t HEAD\n\nexpecting success: \n                {\n                        echo ${HC}t/v:1:vvv\n                        echo ${HC}v:1:vvv\n                } >expected &&\n                git grep --max-depth 0 -n -e vvv $H -- t . >actual &&\n                test_cmp expected actual\n\nok 21 - grep --max-depth 0 -- t . HEAD\n\nexpecting success: \n                echo \"${HC}ab:a+bc\" >expected &&\n                git -c grep.extendedRegexp=false grep \"a+b*c\" $H ab >actual &&\n                test_cmp expected actual\n\nok 22 - grep HEAD with grep.extendedRegexp=false\n\nexpecting success: \n                echo \"${HC}ab:abc\" >expected &&\n                git -c grep.extendedRegexp=true grep \"a+b*c\" $H ab >actual &&\n                test_cmp expected actual\n\nok 23 - grep HEAD with grep.extendedRegexp=true\n\nexpecting success: \n                echo \"${HC}ab:a+bc\" >expected &&\n                git -c grep.patterntype=basic grep \"a+b*c\" $H ab >actual &&\n                test_cmp expected actual\n\nok 24 - grep HEAD with grep.patterntype=basic\n\nexpecting success: \n                echo \"${HC}ab:abc\" >expected &&\n                git -c grep.patterntype=extended grep \"a+b*c\" $H ab >actual &&\n                test_cmp expected actual\n\nok 25 - grep HEAD with grep.patterntype=extended\n\nexpecting success: \n                echo \"${HC}ab:a+b*c\" >expected &&\n                git -c grep.patterntype=fixed grep \"a+b*c\" $H ab >actual &&\n                test_cmp expected actual\n\nok 26 - grep HEAD with grep.patterntype=fixed\n\nexpecting success: \n                echo \"${HC}ab:a+b*c\" >expected &&\n                git -c grep.patterntype=perl grep \"a\\x{2b}b\\x{2a}c\" $H ab >actual &&\n                test_cmp expected actual\n\nok 27 - grep HEAD with grep.patterntype=perl\n\nexpecting success: \n                echo \"${HC}ab:abc\" >expected &&\n                git \\\n                        -c grep.patternType=default \\\n                        -c grep.extendedRegexp=true \\\n                        grep \"a+b*c\" $H ab >actual &&\n                test_cmp expected actual\n\nok 28 - grep HEAD with grep.patternType=default and grep.extendedRegexp=true\n\nexpecting success: \n                echo \"${HC}ab:abc\" >expected &&\n                git \\\n                        -c grep.extendedRegexp=true \\\n                        -c grep.patternType=default \\\n                        grep \"a+b*c\" $H ab >actual &&\n                test_cmp expected actual\n\nok 29 - grep HEAD with grep.extendedRegexp=true and grep.patternType=default\n\nexpecting success: \n                echo \"${HC}ab:abc\" >expected &&\n                git \\\n                        -c grep.patternType=extended \\\n                        -c grep.extendedRegexp=false \\\n                        grep \"a+b*c\" $H ab >actual &&\n                test_cmp expected actual\n\nok 30 - grep HEAD with grep.patternType=extended and grep.extendedRegexp=false\n\nexpecting success: \n                echo \"${HC}ab:a+bc\" >expected &&\n                git \\\n                        -c grep.patternType=basic \\\n                        -c grep.extendedRegexp=true \\\n                        grep \"a+b*c\" $H ab >actual &&\n                test_cmp expected actual\n\nok 31 - grep HEAD with grep.patternType=basic and grep.extendedRegexp=true\n\nexpecting success: \n                echo \"${HC}ab:abc\" >expected &&\n                git \\\n                        -c grep.extendedRegexp=false \\\n                        -c grep.patternType=extended \\\n                        grep \"a+b*c\" $H ab >actual &&\n                test_cmp expected actual\n\nok 32 - grep HEAD with grep.extendedRegexp=false and grep.patternType=extended\n\nexpecting success: \n                echo \"${HC}ab:a+bc\" >expected &&\n                git \\\n                        -c grep.extendedRegexp=true \\\n                        -c grep.patternType=basic \\\n                        grep \"a+b*c\" $H ab >actual &&\n                test_cmp expected actual\n\nok 33 - grep HEAD with grep.extendedRegexp=true and grep.patternType=basic\n\nexpecting success: \n                echo ${HC}ab:3 >expected &&\n                git grep --count -e b $H -- ab >actual &&\n                test_cmp expected actual\n\nok 34 - grep --count HEAD\n\nexpecting success: \n                echo 3 >expected &&\n                git grep --count -h -e b $H -- ab >actual &&\n                test_cmp expected actual\n\nok 35 - grep --count -h HEAD\n\nexpecting success: \n                {\n                        echo ${HC}file:1:foo mmap bar\n                        echo ${HC}file:3:foo_mmap bar mmap\n                        echo ${HC}file:4:foo mmap bar_mmap\n                        echo ${HC}file:5:foo_mmap bar mmap baz\n                } >expected &&\n                git -c grep.linenumber=false grep -n -w -e mmap $H >actual &&\n                test_cmp expected actual\n\nok 36 - grep -w in working tree\n\nexpecting success: \n                {\n                        echo ${HC}file:1:foo mmap bar\n                        echo ${HC}file:3:foo_mmap bar mmap\n                        echo ${HC}file:4:foo mmap bar_mmap\n                        echo ${HC}file:5:foo_mmap bar mmap baz\n                } >expected &&\n                git -c grep.linenumber=true grep -w -e mmap $H >actual &&\n                test_cmp expected actual\n\nok 37 - grep -w in working tree\n\nexpecting success: \n                {\n                        echo ${HC}file:foo mmap bar\n                        echo ${HC}file:foo_mmap bar mmap\n                        echo ${HC}file:foo mmap bar_mmap\n                        echo ${HC}file:foo_mmap bar mmap baz\n                } >expected &&\n                git -c grep.linenumber=true grep --no-line-number -w -e mmap $H >actual &&\n                test_cmp expected actual\n\nok 38 - grep -w in working tree\n\nexpecting success: \n                : >expected &&\n                test_must_fail git grep -n -w -e \"^w\" $H >actual &&\n                test_cmp expected actual\n\nok 39 - grep -w in working tree (w)\n\nexpecting success: \n                {\n                        echo ${HC}x:1:x x xx x\n                } >expected &&\n                git grep -n -w -e \"x xx* x\" $H >actual &&\n                test_cmp expected actual\n\nok 40 - grep -w in working tree (x)\n\nexpecting success: \n                {\n                        echo ${HC}y:1:y yy\n                } >expected &&\n                git grep -n -w -e \"^y\" $H >actual &&\n                test_cmp expected actual\n\nok 41 - grep -w in working tree (y-1)\n\nexpecting success: \n                : >expected &&\n                if git grep -n -w -e \"^y y\" $H >actual\n                then\n                        echo should not have matched\n                        cat actual\n                        false\n                else\n                        test_cmp expected actual\n                fi\n\nok 42 - grep -w in working tree (y-2)\n\nexpecting success: \n                : >expected &&\n                if git grep -n -w -e \"^z\" $H >actual\n                then\n                        echo should not have matched\n                        cat actual\n                        false\n                else\n                        test_cmp expected actual\n                fi\n\nok 43 - grep -w in working tree (z)\n\nexpecting success: \n                echo \"${HC}t/t:1:test\" >expected &&\n                git grep -n -e test $H >actual &&\n                test_cmp expected actual\n\nok 44 - grep in working tree (t-1)\n\nexpecting success: \n                echo \"${HC}t:1:test\" >expected &&\n                (\n                        cd t &&\n                        git grep -n -e test $H\n                ) >actual &&\n                test_cmp expected actual\n\nok 45 - grep in working tree (t-2)\n\nexpecting success: \n                echo \"${HC}t/t:1:test\" >expected &&\n                (\n                        cd t &&\n                        git grep --full-name -n -e test $H\n                ) >actual &&\n                test_cmp expected actual\n\nok 46 - grep in working tree (t-3)\n\nexpecting success: \n                ! git grep -c test $H | grep /dev/null\n        \nok 47 - grep -c in working tree (no /dev/null)\n\nexpecting success: \n                {\n                        echo ${HC}t/a/v:1:vvv\n                        echo ${HC}t/v:1:vvv\n                        echo ${HC}v:1:vvv\n                } >expected &&\n                git grep --max-depth -1 -n -e vvv $H >actual &&\n                test_cmp expected actual\n\nok 48 - grep --max-depth -1 in working tree\n\nexpecting success: \n                {\n                        echo ${HC}v:1:vvv\n                } >expected &&\n                git grep --max-depth 0 -n -e vvv $H >actual &&\n                test_cmp expected actual\n\nok 49 - grep --max-depth 0 in working tree\n\nexpecting success: \n                {\n                        echo ${HC}t/a/v:1:vvv\n                        echo ${HC}t/v:1:vvv\n                        echo ${HC}v:1:vvv\n                } >expected &&\n                git grep --max-depth 0 -n -e vvv $H -- \"*\" >actual &&\n                test_cmp expected actual\n\nok 50 - grep --max-depth 0 -- '*' in working tree\n\nexpecting success: \n                {\n                        echo ${HC}t/v:1:vvv\n                        echo ${HC}v:1:vvv\n                } >expected &&\n                git grep --max-depth 1 -n -e vvv $H >actual &&\n                test_cmp expected actual\n\nok 51 - grep --max-depth 1 in working tree\n\nexpecting success: \n                {\n                        echo ${HC}t/v:1:vvv\n                } >expected &&\n                git grep --max-depth 0 -n -e vvv $H -- t >actual &&\n                test_cmp expected actual\n\nok 52 - grep --max-depth 0 -- t in working tree\n\nexpecting success: \n                {\n                        echo ${HC}t/v:1:vvv\n                        echo ${HC}v:1:vvv\n                } >expected &&\n                git grep --max-depth 0 -n -e vvv $H -- . t >actual &&\n                test_cmp expected actual\n\nok 53 - grep --max-depth 0 -- . t in working tree\n\nexpecting success: \n                {\n                        echo ${HC}t/v:1:vvv\n                        echo ${HC}v:1:vvv\n                } >expected &&\n                git grep --max-depth 0 -n -e vvv $H -- t . >actual &&\n                test_cmp expected actual\n\nok 54 - grep --max-depth 0 -- t . in working tree\n\nexpecting success: \n                echo \"${HC}ab:a+bc\" >expected &&\n                git -c grep.extendedRegexp=false grep \"a+b*c\" $H ab >actual &&\n                test_cmp expected actual\n\nok 55 - grep in working tree with grep.extendedRegexp=false\n\nexpecting success: \n                echo \"${HC}ab:abc\" >expected &&\n                git -c grep.extendedRegexp=true grep \"a+b*c\" $H ab >actual &&\n                test_cmp expected actual\n\nok 56 - grep in working tree with grep.extendedRegexp=true\n\nexpecting success: \n                echo \"${HC}ab:a+bc\" >expected &&\n                git -c grep.patterntype=basic grep \"a+b*c\" $H ab >actual &&\n                test_cmp expected actual\n\nok 57 - grep in working tree with grep.patterntype=basic\n\nexpecting success: \n                echo \"${HC}ab:abc\" >expected &&\n                git -c grep.patterntype=extended grep \"a+b*c\" $H ab >actual &&\n                test_cmp expected actual\n\nok 58 - grep in working tree with grep.patterntype=extended\n\nexpecting success: \n                echo \"${HC}ab:a+b*c\" >expected &&\n                git -c grep.patterntype=fixed grep \"a+b*c\" $H ab >actual &&\n                test_cmp expected actual\n\nok 59 - grep in working tree with grep.patterntype=fixed\n\nexpecting success: \n                echo \"${HC}ab:a+b*c\" >expected &&\n                git -c grep.patterntype=perl grep \"a\\x{2b}b\\x{2a}c\" $H ab >actual &&\n                test_cmp expected actual\n\nok 60 - grep in working tree with grep.patterntype=perl\n\nexpecting success: \n                echo \"${HC}ab:abc\" >expected &&\n                git \\\n                        -c grep.patternType=default \\\n                        -c grep.extendedRegexp=true \\\n                        grep \"a+b*c\" $H ab >actual &&\n                test_cmp expected actual\n\nok 61 - grep in working tree with grep.patternType=default and grep.extendedRegexp=true\n\nexpecting success: \n                echo \"${HC}ab:abc\" >expected &&\n                git \\\n                        -c grep.extendedRegexp=true \\\n                        -c grep.patternType=default \\\n                        grep \"a+b*c\" $H ab >actual &&\n                test_cmp expected actual\n\nok 62 - grep in working tree with grep.extendedRegexp=true and grep.patternType=default\n\nexpecting success: \n                echo \"${HC}ab:abc\" >expected &&\n                git \\\n                        -c grep.patternType=extended \\\n                        -c grep.extendedRegexp=false \\\n                        grep \"a+b*c\" $H ab >actual &&\n                test_cmp expected actual\n\nok 63 - grep in working tree with grep.patternType=extended and grep.extendedRegexp=false\n\nexpecting success: \n                echo \"${HC}ab:a+bc\" >expected &&\n                git \\\n                        -c grep.patternType=basic \\\n                        -c grep.extendedRegexp=true \\\n                        grep \"a+b*c\" $H ab >actual &&\n                test_cmp expected actual\n\nok 64 - grep in working tree with grep.patternType=basic and grep.extendedRegexp=true\n\nexpecting success: \n                echo \"${HC}ab:abc\" >expected &&\n                git \\\n                        -c grep.extendedRegexp=false \\\n                        -c grep.patternType=extended \\\n                        grep \"a+b*c\" $H ab >actual &&\n                test_cmp expected actual\n\nok 65 - grep in working tree with grep.extendedRegexp=false and grep.patternType=extended\n\nexpecting success: \n                echo \"${HC}ab:a+bc\" >expected &&\n                git \\\n                        -c grep.extendedRegexp=true \\\n                        -c grep.patternType=basic \\\n                        grep \"a+b*c\" $H ab >actual &&\n                test_cmp expected actual\n\nok 66 - grep in working tree with grep.extendedRegexp=true and grep.patternType=basic\n\nexpecting success: \n                echo ${HC}ab:3 >expected &&\n                git grep --count -e b $H -- ab >actual &&\n                test_cmp expected actual\n\nok 67 - grep --count in working tree\n\nexpecting success: \n                echo 3 >expected &&\n                git grep --count -h -e b $H -- ab >actual &&\n                test_cmp expected actual\n\nok 68 - grep --count -h in working tree\n\nexpecting success: \n        git grep -l -C1 foo >actual &&\n        test_cmp expected actual\n\nok 69 - grep -l -C\n\nexpecting success: \n        git grep -c -C1 foo >actual &&\n        test_cmp expected actual\n\nok 70 - grep -l -C\n\nexpecting success: \n        git ls-files >expected &&\n        git grep -L -C1 nonexistent_string >actual &&\n        test_cmp expected actual\n\nok 71 - grep -L -C\n\nexpecting success: \n        git grep -e \"foo mmap\" --and -e bar_mmap >actual &&\n        test_cmp expected actual\n\nok 72 - grep -e A --and -e B\n\nexpecting success: \n        git grep \\( -e foo_ --or -e baz \\) \\\n                --and -e \" mmap\" >actual &&\n        test_cmp expected actual\n\nok 73 - grep ( -e A --or -e B ) --and -e B\n\nexpecting success: \n        git grep -e \"foo mmap\" --and --not -e bar_mmap >actual &&\n        test_cmp expected actual\n\nok 74 - grep -e A --and --not -e B\n\nexpecting success: \n        GREP_OPTIONS=-v git grep \" mmap bar\\$\" >actual &&\n        test_cmp expected actual\n\nok 75 - grep should ignore GREP_OPTIONS\n\nexpecting success: \n        test_must_fail git grep -f patterns\n\nfatal: cannot open 'patterns': No such file or directory\nok 76 - grep -f, non-existent file\n\nexpecting success: \n        git grep -f pattern >actual &&\n        test_cmp expected actual\n\nok 77 - grep -f, one pattern\n\nexpecting success: \n        git grep -f patterns >actual &&\n        test_cmp expected actual\n\nok 78 - grep -f, multiple patterns\n\nexpecting success: \n        git grep \"$(cat patterns)\" >actual &&\n        test_cmp expected actual\n\nok 79 - grep, multiple patterns\n\nexpecting success: \n        git grep -f patterns >actual &&\n        test_cmp expected actual\n\nok 80 - grep -f, ignore empty lines\n\nexpecting success: \n        git grep -f - <patterns >actual &&\n        test_cmp expected actual\n\nok 81 - grep -f, ignore empty lines, read patterns from stdin\n\nexpecting success: \n        >empty &&\n        git grep -q mmap >actual &&\n        test_cmp empty actual &&\n        test_must_fail git grep -q qfwfq >actual &&\n        test_cmp empty actual\n\nok 82 - grep -q, silently report matches\n\nexpecting success: \n        git grep -C1 \"^[yz]\" >actual &&\n        test_cmp expected actual\n\nok 83 - grep -C1 hunk mark between files\n\nexpecting success: \n        echo a >>file &&\n        test_tick &&\n        GIT_AUTHOR_NAME=\"With * Asterisk\" \\\n        GIT_AUTHOR_EMAIL=\"xyzzy@frotz.com\" \\\n        git commit -a -m \"second\" &&\n\n        echo a >>file &&\n        test_tick &&\n        git commit -a -m \"third\" &&\n\n        echo a >>file &&\n        test_tick &&\n        GIT_AUTHOR_NAME=\"Night Fall\" \\\n        GIT_AUTHOR_EMAIL=\"nitfol@frobozz.com\" \\\n        git commit -a -m \"fourth\"\n\n[master b39ecf0] second\n Author: With * Asterisk <xyzzy@frotz.com>\n 1 file changed, 1 insertion(+)\n[master 8f9afb5] third\n Author: A U Thor <author@example.com>\n 1 file changed, 1 insertion(+)\n[master 2d5652e] fourth\n Author: Night Fall <nitfol@frobozz.com>\n 1 file changed, 1 insertion(+)\nok 84 - log grep setup\n\nexpecting success: \n        git log --author=author --pretty=tformat:%s >actual &&\n        {\n                echo third && echo initial\n        } >expect &&\n        test_cmp expect actual\n\nok 85 - log grep (1)\n\nexpecting success: \n        git log --author=\" * \" -F --pretty=tformat:%s >actual &&\n        {\n                echo second\n        } >expect &&\n        test_cmp expect actual\n\nok 86 - log grep (2)\n\nexpecting success: \n        git log --author=\"^A U\" --pretty=tformat:%s >actual &&\n        {\n                echo third && echo initial\n        } >expect &&\n        test_cmp expect actual\n\nok 87 - log grep (3)\n\nexpecting success: \n        git log --author=\"frotz\\.com>$\" --pretty=tformat:%s >actual &&\n        {\n                echo second\n        } >expect &&\n        test_cmp expect actual\n\nok 88 - log grep (4)\n\nexpecting success: \n        git log --author=Thor -F --pretty=tformat:%s >actual &&\n        {\n                echo third && echo initial\n        } >expect &&\n        test_cmp expect actual\n\nok 89 - log grep (5)\n\nexpecting success: \n        git log --author=-0700  --pretty=tformat:%s >actual &&\n        >expect &&\n        test_cmp expect actual\n\nok 90 - log grep (6)\n\nexpecting success: \n        git log -g --grep-reflog=\"commit: third\" --pretty=tformat:%s >actual &&\n        echo third >expect &&\n        test_cmp expect actual\n\nok 91 - log grep (7)\n\nexpecting success: \n        git log -g --grep-reflog=\"commit: third\" --grep-reflog=\"commit: second\" --pretty=tformat:%s >actual &&\n        {\n                echo third && echo second\n        } >expect &&\n        test_cmp expect actual\n\nok 92 - log grep (8)\n\nexpecting success: \n        git log -g --grep-reflog=\"commit: third\" --author=\"Thor\" --pretty=tformat:%s >actual &&\n        echo third >expect &&\n        test_cmp expect actual\n\nok 93 - log grep (9)\n\nexpecting success: \n        git log -g --grep-reflog=\"commit: third\" --author=\"non-existant\" --pretty=tformat:%s >actual &&\n        : >expect &&\n        test_cmp expect actual\n\nok 94 - log grep (9)\n\nexpecting success: \n        test_must_fail git log --grep-reflog=\"commit: third\"\n\nfatal: cannot use --grep-reflog without --walk-reflogs\nok 95 - log --grep-reflog can only be used under -g\n\nexpecting success: \n        git log --grep=i --grep=r --format=%s >actual &&\n        {\n                echo fourth && echo third && echo initial\n        } >expect &&\n        test_cmp expect actual\n\nok 96 - log with multiple --grep uses union\n\nexpecting success: \n        git log --all-match --grep=i --grep=r --format=%s >actual &&\n        {\n                echo third\n        } >expect &&\n        test_cmp expect actual\n\nok 97 - log --all-match with multiple --grep uses intersection\n\nexpecting success: \n        git log --author=\"Thor\" --author=\"Aster\" --format=%s >actual &&\n        {\n            echo third && echo second && echo initial\n        } >expect &&\n        test_cmp expect actual\n\nok 98 - log with multiple --author uses union\n\nexpecting success: \n        git log --all-match --author=\"Thor\" --author=\"Aster\" --format=%s >actual &&\n        {\n            echo third && echo second && echo initial\n        } >expect &&\n        test_cmp expect actual\n\nok 99 - log --all-match with multiple --author still uses union\n\nexpecting success: \n        # grep matches only third and fourth\n        # author matches only initial and third\n        git log --author=\"A U Thor\" --grep=r --format=%s >actual &&\n        {\n                echo third\n        } >expect &&\n        test_cmp expect actual\n\nok 100 - log --grep --author uses intersection\n\nexpecting success: \n        # grep matches initial and second but not third\n        # author matches only initial and third\n        git log --author=\"A U Thor\" --grep=s --grep=l --format=%s >actual &&\n        {\n                echo initial\n        } >expect &&\n        test_cmp expect actual\n\nok 101 - log --grep --grep --author takes union of greps and intersects with author\n\nexpecting success: \n        # grep matches only initial and third\n        # author matches all but second\n        git log --all-match --author=\"Thor\" --author=\"Night\" --grep=i --format=%s >actual &&\n        {\n            echo third && echo initial\n        } >expect &&\n        test_cmp expect actual\n\nok 102 - log ---all-match -grep --author --author still takes union of authors and intersects with grep\n\nexpecting success: \n        # grep matches only initial and third\n        # author matches all but second\n        git log --author=\"Thor\" --author=\"Night\" --grep=i --format=%s >actual &&\n        {\n            echo third && echo initial\n        } >expect &&\n        test_cmp expect actual\n\nok 103 - log --grep --author --author takes union of authors and intersects with grep\n\nexpecting success: \n        # grep matches only third\n        # author matches only initial and third\n        git log --all-match --author=\"A U Thor\" --grep=i --grep=r --format=%s >actual &&\n        {\n                echo third\n        } >expect &&\n        test_cmp expect actual\n\nok 104 - log --all-match --grep --grep --author takes intersection\n\nexpecting success: \n        : >expect &&\n        git log --author=\"$GIT_AUTHOR_DATE\" >actual &&\n        test_cmp expect actual\n\nok 105 - log --author does not search in timestamp\n\nexpecting success: \n        : >expect &&\n        git log --committer=\"$GIT_COMMITTER_DATE\" >actual &&\n        test_cmp expect actual\n\nok 106 - log --committer does not search in timestamp\n\nexpecting success: \n        git update-index --assume-unchanged t/t &&\n        rm t/t &&\n        test \"$(git grep test)\" = \"t/t:test\" &&\n        git update-index --no-assume-unchanged t/t &&\n        git checkout t/t\n\nok 107 - grep with CE_VALID file\n\nexpecting success: \n        git config diff.custom.funcname \"^#\" &&\n        echo \"hello.c diff=custom\" >.gitattributes &&\n        git grep -p return >actual &&\n        test_cmp expected actual\n\nok 108 - grep -p with userdiff\n\nexpecting success: \n        rm -f .gitattributes &&\n        git grep -p return >actual &&\n        test_cmp expected actual\n\nok 109 - grep -p\n\nexpecting success: \n        git grep -p -B5 return >actual &&\n        test_cmp expected actual\n\nok 110 - grep -p -B5\n\nexpecting success: \n        git grep -W return >actual &&\n        test_cmp expected actual\n\nok 111 - grep -W\n\nexpecting success: \n        test_when_finished \"rm -f .gitattributes\" &&\n        git config diff.custom.xfuncname \"(printf.*|})$\" &&\n        echo \"hello.c diff=custom\" >.gitattributes &&\n        git grep -W return >actual &&\n        test_cmp expected actual\n\nok 112 - grep -W with userdiff\n\nexpecting success: \n        mkdir -p s &&\n        (\n                cd s && git grep \"x x x\" ..\n        )\n\n../x:x x xx x\nok 113 - grep from a subdirectory to search wider area (1)\n\nexpecting success: \n        mkdir -p s &&\n        (\n                cd s || exit 1\n                ( git grep xxyyzz .. >out ; echo $? >status )\n                ! test -s out &&\n                test 1 = $(cat status)\n        )\n\nok 114 - grep from a subdirectory to search wider area (2)\n\nexpecting success: \n        git grep -Fi \"CHAR *\" >actual &&\n        test_cmp expected actual\n\nok 115 - grep -Fi\n\nexpecting success: \n        rm -fr non &&\n        mkdir -p non/git/sub &&\n        echo hello >non/git/file1 &&\n        echo world >non/git/sub/file2 &&\n        {\n                echo file1:hello &&\n                echo sub/file2:world\n        } >non/expect.full &&\n        echo file2:world >non/expect.sub &&\n        (\n                GIT_CEILING_DIRECTORIES=\"$(pwd)/non/git\" &&\n                export GIT_CEILING_DIRECTORIES &&\n                cd non/git &&\n                test_must_fail git grep o &&\n                git grep --no-index o >../actual.full &&\n                test_cmp ../expect.full ../actual.full\n                cd sub &&\n                test_must_fail git grep o &&\n                git grep --no-index o >../../actual.sub &&\n                test_cmp ../../expect.sub ../../actual.sub\n        ) &&\n\n        echo \".*o*\" >non/git/.gitignore &&\n        (\n                GIT_CEILING_DIRECTORIES=\"$(pwd)/non/git\" &&\n                export GIT_CEILING_DIRECTORIES &&\n                cd non/git &&\n                test_must_fail git grep o &&\n                git grep --no-index --exclude-standard o >../actual.full &&\n                test_cmp ../expect.full ../actual.full &&\n\n                {\n                        echo \".gitignore:.*o*\"\n                        cat ../expect.full\n                } >../expect.with.ignored &&\n                git grep --no-index --no-exclude o >../actual.full &&\n                test_cmp ../expect.with.ignored ../actual.full\n        )\n\nfatal: Not a git repository (or any of the parent directories): .git\nok 116 - outside of git repository\n\nexpecting success: \n        rm -fr is &&\n        mkdir -p is/git/sub &&\n        echo hello >is/git/file1 &&\n        echo world >is/git/sub/file2 &&\n        echo \".*o*\" >is/git/.gitignore &&\n        {\n                echo file1:hello &&\n                echo sub/file2:world\n        } >is/expect.unignored &&\n        {\n                echo \".gitignore:.*o*\" &&\n                cat is/expect.unignored\n        } >is/expect.full &&\n        : >is/expect.empty &&\n        echo file2:world >is/expect.sub &&\n        (\n                cd is/git &&\n                git init &&\n                test_must_fail git grep o >../actual.full &&\n                test_cmp ../expect.empty ../actual.full &&\n\n                git grep --untracked o >../actual.unignored &&\n                test_cmp ../expect.unignored ../actual.unignored &&\n\n                git grep --no-index o >../actual.full &&\n                test_cmp ../expect.full ../actual.full &&\n\n                git grep --no-index --exclude-standard o >../actual.unignored &&\n                test_cmp ../expect.unignored ../actual.unignored &&\n\n                cd sub &&\n                test_must_fail git grep o >../../actual.sub &&\n                test_cmp ../../expect.empty ../../actual.sub &&\n\n                git grep --no-index o >../../actual.sub &&\n                test_cmp ../../expect.sub ../../actual.sub &&\n\n                git grep --untracked o >../../actual.sub &&\n                test_cmp ../../expect.sub ../../actual.sub\n        )\n\nInitialized empty Git repository in /usr/src/dev-vcs/git-2.7.3-r1/work/git-2.7.3/t/trash directory.t7810-grep/is/git/.git/\nok 117 - inside git repository but with --no-index\n\nexpecting success: \ncat >double-dash <<EOF &&\n--\n->\nother\nEOF\ngit add double-dash\n\nok 118 - setup double-dash tests\n\nexpecting success: \n        git grep -- \"->\" >actual &&\n        test_cmp expected actual\n\nok 119 - grep -- pattern\n\nexpecting success: \n        git grep -- \"->\" -- double-dash >actual &&\n        test_cmp expected actual\n\nok 120 - grep -- pattern -- pathspec\n\nexpecting success: \n        git grep -e \"->\" -- double-dash >actual &&\n        test_cmp expected actual\n\nok 121 - grep -e pattern -- path\n\nexpecting success: \n        git grep -e -- -- double-dash >actual &&\n        test_cmp expected actual\n\nok 122 - grep -e -- -- path\n\nexpecting success: \n        git grep --perl-regexp \"\\p{Ps}.*?\\p{Pe}\" hello.c >actual &&\n        test_cmp expected actual\n\nok 123 - grep --perl-regexp pattern\n\nexpecting success: \n        git grep -P \"\\p{Ps}.*?\\p{Pe}\" hello.c >actual &&\n        test_cmp expected actual\n\nok 124 - grep -P pattern\n\nexpecting success: \n        >empty &&\n        test_must_fail git -c grep.extendedregexp=true \\\n                grep \"\\p{Ps}.*?\\p{Pe}\" hello.c >actual &&\n        test_cmp empty actual\n\nfatal: command line, '\\p{Ps}.*?\\p{Pe}': Invalid contents of {}\nok 125 - grep pattern with grep.extendedRegexp=true\n\nexpecting success: \n        git -c grep.extendedregexp=true \\\n                grep -P \"\\p{Ps}.*?\\p{Pe}\" hello.c >actual &&\n        test_cmp expected actual\n\nok 126 - grep -P pattern with grep.extendedRegexp=true\n\nexpecting success: \n        {\n                echo \"ab:a+b*c\"\n                echo \"ab:a+bc\"\n        } >expected &&\n        git grep -P -v \"abc\" ab >actual &&\n        test_cmp expected actual\n\nok 127 - grep -P -v pattern\n\nexpecting success: \n        cat >expected <<-EOF &&\n        hello.c:        printf(\"Hello world.\\n\");\n        EOF\n        git grep -P -i \"PRINTF\\([^\\d]+\\)\" hello.c >actual &&\n        test_cmp expected actual\n\nok 128 - grep -P -i pattern\n\nexpecting success: \n        {\n                echo \"hello_world:Hello world\"\n                echo \"hello_world:HeLLo world\"\n        } >expected &&\n        git grep -P -w \"He((?i)ll)o\" hello_world >actual &&\n        test_cmp expected actual\n\nok 129 - grep -P -w pattern\n\nexpecting success: \n        test_must_fail git grep -G \"a[\"\n\nfatal: command line, 'a[': Missing ']'\nok 130 - grep -G invalidpattern properly dies \n\nexpecting success: \n        test_must_fail git -c grep.patterntype=basic grep \"a[\"\n\nfatal: command line, 'a[': Missing ']'\nok 131 - grep invalidpattern properly dies with grep.patternType=basic\n\nexpecting success: \n        test_must_fail git grep -E \"a[\"\n\nfatal: command line, 'a[': Missing ']'\nok 132 - grep -E invalidpattern properly dies \n\nexpecting success: \n        test_must_fail git -c grep.patterntype=extended grep \"a[\"\n\nfatal: command line, 'a[': Missing ']'\nok 133 - grep invalidpattern properly dies with grep.patternType=extended\n\nexpecting success: \n        test_must_fail git grep -P \"a[\"\n\nfatal: command line, 'a[': missing terminating ] for character class\nok 134 - grep -P invalidpattern properly dies \n\nexpecting success: \n        test_must_fail git -c grep.patterntype=perl grep \"a[\"\n\nfatal: command line, 'a[': missing terminating ] for character class\nok 135 - grep invalidpattern properly dies with grep.patternType=perl\n\nexpecting success: \n        echo \"ab:a+b*c\" >expected &&\n        git grep -G -E -F \"a+b*c\" ab >actual &&\n        test_cmp expected actual\n\nok 136 - grep -G -E -F pattern\n\nexpecting success: \n        echo \"ab:a+b*c\" >expected &&\n        git \\\n                -c grep.patterntype=basic \\\n                -c grep.patterntype=extended \\\n                -c grep.patterntype=fixed \\\n                grep \"a+b*c\" ab >actual &&\n        test_cmp expected actual\n\nok 137 - grep pattern with grep.patternType=basic, =extended, =fixed\n\nexpecting success: \n        echo \"ab:a+bc\" >expected &&\n        git grep -E -F -G \"a+b*c\" ab >actual &&\n        test_cmp expected actual\n\nok 138 - grep -E -F -G pattern\n\nexpecting success: \n        echo \"ab:a+bc\" >expected &&\n        git \\\n                -c grep.patterntype=extended \\\n                -c grep.patterntype=fixed \\\n                -c grep.patterntype=basic \\\n                grep \"a+b*c\" ab >actual &&\n        test_cmp expected actual\n\nok 139 - grep pattern with grep.patternType=extended, =fixed, =basic\n\nexpecting success: \n        echo \"ab:abc\" >expected &&\n        git grep -F -G -E \"a+b*c\" ab >actual &&\n        test_cmp expected actual\n\nok 140 - grep -F -G -E pattern\n\nexpecting success: \n        echo \"ab:abc\" >expected &&\n        git \\\n                -c grep.patterntype=fixed \\\n                -c grep.patterntype=basic \\\n                -c grep.patterntype=extended \\\n                grep \"a+b*c\" ab >actual &&\n        test_cmp expected actual\n\nok 141 - grep pattern with grep.patternType=fixed, =basic, =extended\n\nexpecting success: \n        >empty &&\n        test_must_fail git grep -G -F -P -E \"a\\x{2b}b\\x{2a}c\" ab >actual &&\n        test_cmp empty actual\n\ntest_must_fail: command succeeded: git grep -G -F -P -E a\\x{2b}b\\x{2a}c ab\nnot ok 142 - grep -G -F -P -E pattern\n#\n#               >empty &&\n#               test_must_fail git grep -G -F -P -E \"a\\x{2b}b\\x{2a}c\" ab >actual &&\n#               test_cmp empty actual\n#\nelaine t # elaine t # cd trash\\ directory.t7810-grep/\nelaine trash directory.t7810-grep # git grep -G -F -P -E a\\x{2b}b\\x{2a}c ab >actual\nfatal: command line, 'ax{2b}bx{2a}c': Invalid contents of {}\nelaine trash directory.t7810-grep # echo $?\n128\nelaine trash directory.t7810-grep # cat actual\nelaine trash directory.t7810-grep # rm actual\nelaine trash directory.t7810-grep #\n"},{"id":"309025","messageId":"20170109112706.zezc2kt44u3652jm@sigill.intra.peff.net","threadId":"44800","inReplyTo":"58736B2A.40003@adelielinux.org","subject":"Re: Test failures when Git is built with libpcre and grep is built without it","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2017-01-09T11:27:06Z","receivedAt":"2017-01-09T11:38:16Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Jan 09, 2017 at 04:51:22AM -0600, A. Wilcox wrote:\n\n> Interestingly enough, you seem to be right.  The failure is very\n> bizarre and has nothing to do with system /bin/grep:\n> \n> test_must_fail: command succeeded: git grep -G -F -P -E a\\x{2b}b\\x{2a}c ab\n> not ok 142 - grep -G -F -P -E pattern\n> #\n> #               >empty &&\n> #               test_must_fail git grep -G -F -P -E \"a\\x{2b}b\\x{2a}c\"\n> ab >actual &&\n> #               test_cmp empty actual\n> #\n> \n> However:\n> \n> elaine trash directory.t7810-grep # git grep -G -F -P -E\n> a\\x{2b}b\\x{2a}c ab >actual\n> fatal: command line, 'ax{2b}bx{2a}c': Invalid contents of {}\n\nHrm, it looks like your shell eats the backslashes in a double-quoted\nstring.\n\nWhat does:\n\n  printf '%s\\n' \"a\\x{2b}b\\x{2a}c\"\n\nshow?\n\nI'm not sure if that's related or not. And as you said your shell is\nbash, that seems weird. Lots of other people run bash, and we haven't\ngotten a report (and your version isn't bleeding edge).\n\nThat said, the \"invalid contents\" error message is expected. What's\nconfusing is that the command returned success. The error comes from\ncompile_regexp(), which sees that regcomp() failed. It calls\ncompile_regexp_failed(), which calls die(), which should end in\nexit(128). But the shell sees the exit code as 0. Weird.\n\nYour example run after shows that the correct exit code comes out of\ngit. What does:\n\n  ./t7810-grep.sh -x --verbose-only=142\n\nsay? That should enable \"set -x\" in the shell just for that test.\n\n-Peff\n\nPS In my repo, the test that is failing for you is actually 145. Are you\n   trying with a version of git older than v2.7.x? If so, you might\n   double-check that the problem persists on the latest \"master\". I\n   don't know of any particular fixes, but it's worth a shot.\n\n-Peff\n"},{"id":"309030","messageId":"871swcjsd3.fsf@linux-m68k.org","threadId":"44800","inReplyTo":"58736B2A.40003@adelielinux.org","subject":"Re: Test failures when Git is built with libpcre and grep is built without it","fromName":"Andreas Schwab","fromEmail":"schwab@linux-m68k.org","sentAt":"2017-01-09T13:05:44Z","receivedAt":"2017-01-09T13:06:12Z","isPatch":false,"sender":{"key":"schwab@linux-m68k.org","avatar":"https://avatars.githubusercontent.com/u/2175493?v=4"},"body":"On Jan 09 2017, \"A. Wilcox\" <awilfox@adelielinux.org> wrote:\n\n> Interestingly enough, you seem to be right.  The failure is very\n> bizarre and has nothing to do with system /bin/grep:\n>\n> test_must_fail: command succeeded: git grep -G -F -P -E a\\x{2b}b\\x{2a}c ab\n> not ok 142 - grep -G -F -P -E pattern\n> #\n> #               >empty &&\n> #               test_must_fail git grep -G -F -P -E \"a\\x{2b}b\\x{2a}c\"\n> ab >actual &&\n> #               test_cmp empty actual\n> #\n>\n> However:\n>\n> elaine trash directory.t7810-grep # git grep -G -F -P -E\n> a\\x{2b}b\\x{2a}c ab >actual\n\nYou need to quote the regexp argument, see the line starting with\n\"test_must_fail\" above.\n\nAndreas.\n\n-- \nAndreas Schwab, schwab@linux-m68k.org\nGPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5\n\"And now for something completely different.\"\n"},{"id":"309069","messageId":"20170109213303.4rupe5cqwejfp6af@sigill.intra.peff.net","threadId":"44800","inReplyTo":"871swcjsd3.fsf@linux-m68k.org","subject":"Re: Test failures when Git is built with libpcre and grep is built without it","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2017-01-09T21:33:03Z","receivedAt":"2017-01-09T21:33:16Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Jan 09, 2017 at 02:05:44PM +0100, Andreas Schwab wrote:\n\n> On Jan 09 2017, \"A. Wilcox\" <awilfox@adelielinux.org> wrote:\n> \n> > Interestingly enough, you seem to be right.  The failure is very\n> > bizarre and has nothing to do with system /bin/grep:\n> >\n> > test_must_fail: command succeeded: git grep -G -F -P -E a\\x{2b}b\\x{2a}c ab\n> > not ok 142 - grep -G -F -P -E pattern\n> > #\n> > #               >empty &&\n> > #               test_must_fail git grep -G -F -P -E \"a\\x{2b}b\\x{2a}c\"\n> > ab >actual &&\n> > #               test_cmp empty actual\n> > #\n> >\n> > However:\n> >\n> > elaine trash directory.t7810-grep # git grep -G -F -P -E\n> > a\\x{2b}b\\x{2a}c ab >actual\n> \n> You need to quote the regexp argument, see the line starting with\n> \"test_must_fail\" above.\n\nOh, duh. I checked that the line in the test was quoted, and didn't\nnotice that only the unquoted version he ran later complained. Thanks\nfor noticing, as that explains the mystery, I think.\n\nThe problem is that we are expecting the regex \"\\x{2b}\" to complain in\nregcomp() (as an ERE), but it doesn't. And that probably _is_ related to\nmusl, which is providing the libc regex (I know this looks like a pcre\ntest, but it's checking that \"-P -E\" overrides the pcre option with\n\"-E\").\n\nI'm not sure if musl is wrong for failing to complain about a bogus\nregex. Generally making something that would break into something that\nworks is an OK way to extend the standard. So our test is at fault for\nassuming that the regex will fail. I guess we'd need to find some more\nexotic syntax that pcre supports, but that ERE doesn't. Maybe \"(?:)\" or\nsomething.\n\n-Peff\n"},{"id":"309133","messageId":"5874B942.7070402@adelielinux.org","threadId":"44800","inReplyTo":"20170109213303.4rupe5cqwejfp6af@sigill.intra.peff.net","subject":"Re: Test failures when Git is built with libpcre and grep is built without it","fromName":"A. Wilcox","fromEmail":"awilfox@adelielinux.org","sentAt":"2017-01-10T10:36:50Z","receivedAt":"2017-01-10T10:37:16Z","isPatch":false,"sender":{"key":"awilfox@adelielinux.org","avatar":"https://gravatar.com/avatar/7dfeb1949d7201fcf186c1ef0d0d0664f667c03834d1630eb7d057e7d37c2266?d=mp&s=160"},"body":"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA256\n\n(Hi, musl developers!  Read on for some information regarding what\nbegan as a test failure during packaging of Git 2.7.3 that appears to\nbe related to musl's regexp library.)\n\n\nOn 09/01/17 05:27, Jeff King wrote:\n> Are you trying with a version of git older than v2.7.x?\n\n\nWe are using 2.7.3.  I will admit the version is a bit old, but it is\nworking on all other arches (and it took an inordinate amount of time\nto spin up PowerPC - hooray for toolchain issues).\n\n\nOn 09/01/17 15:33, Jeff King wrote:\n> On Mon, Jan 09, 2017 at 02:05:44PM +0100, Andreas Schwab wrote:\n>> You need to quote the regexp argument, see the line starting\n>> with \"test_must_fail\" above.\n> \n> Oh, duh. I checked that the line in the test was quoted\n\n\nGuilty of this as well.  Sorry about that.  With the proper\ninvocation, I receive a success:\n\n\nelaine trash directory.t7810-grep # git grep -G -F -P -E\n\"a\\x{2b}b\\x{2a}c\" ab\nerror: cannot run less: No such file or directory\nab:a+b*c\nelaine trash directory.t7810-grep # echo $?\n0\n\n\nHaven't managed to build less(1) for PowerPC yet, but it does seem to\nwork when quoted.  Yikes!\n\n\n> The problem is that we are expecting the regex \"\\x{2b}\" to complain\n> in regcomp() (as an ERE), but it doesn't. And that probably _is_\n> related to musl, which is providing the libc regex (I know this\n> looks like a pcre test, but it's checking that \"-P -E\" overrides\n> the pcre option with \"-E\").\n> \n> I'm not sure if musl is wrong for failing to complain about a\n> bogus regex. Generally making something that would break into\n> something that works is an OK way to extend the standard. So our\n> test is at fault for assuming that the regex will fail. I guess\n> we'd need to find some more exotic syntax that pcre supports, but\n> that ERE doesn't. Maybe \"(?:)\" or something.\n> \n> -Peff\n> \n\n\nI am cc:ing in the musl development list to see what their thoughts are.\n\nThanks for the help so far; I really appreciate it.  Hopefully we can\nresolve this in a way that makes musl and Git's test suite both more\ncorrect, if necessary.\n\nHappy new year!\n\n- --arw\n\n\n- -- \nA. Wilcox (awilfox)\nProject Lead, Adélie Linux\nhttp://adelielinux.org\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v2\n\niQIcBAEBCAAGBQJYdLk+AAoJEMspy1GSK50Uz9kP/2JUSzSSXkKLy3788aAjgBOq\naTPBqKXLCvnTeBpsymXoGueaJzgDnYP6Xi9tUb/j4JAXqaJKGHXTgz8ixsFQJ4SJ\np7NN1JZXsIVGKWQHcxvEXEIRmBK7T9BQ2Hq6qUuk3n4PM6lbD1Ur3G1rUqIM/z76\n5cSkvwgvGuOVYXLwSTTprb6EbbZc6WTgcDECFIl4z7eJ3GihChg+EgH4cTDt3xLD\n9VHx++hWoEZXued0g0myENjBMeCiFOpYw1bzxn7d2s8masx/If2TkK0CLdexy2ti\nhFV/F7g8etgZSdmrmiaJIudTsY6p46/sm/VmGm+8yPIeR8/8EOBlyhKhz4EidNtA\n2dpUUJW/RD4uz9yVNjmWhIHaL10weuNLQLd/Tt5O/0dG422vhJxOwwJL9Vhxw70y\n1PprD11+ZUJeWsz91C/Bl9CqHqljDP00QX8w/dbHCDsjeKgfUdksy2iKlHBG0sx3\nCbL0EcHeE9BLmqmJi9ED7w78cTmNryemK29WFHUGSwzR99Rv9QlMn+4GCF1s0O3N\nUKPCueLpPcNvRK+1WHkAwUC0iV97Un3WI6kyExs9khygIHRd1y/yRhbpxibbz337\nFJfOTcT7e/YqML8Nb8EdwECRhdGX5u1tKqaOfBwLC62SKGTPi5qXpjaSPPJcJsrZ\nphxFt6a45PPECV3ZsEO1\n=PMkh\n-----END PGP SIGNATURE-----\n"},{"id":"309142","messageId":"20170110113959.GL17692@port70.net","threadId":"44800","inReplyTo":"5874B942.7070402@adelielinux.org","subject":"Re: [musl] Re: Test failures when Git is built with libpcre and grep is built without it","fromName":"Szabolcs Nagy","fromEmail":"nsz@port70.net","sentAt":"2017-01-10T11:40:00Z","receivedAt":"2017-01-10T11:45:21Z","isPatch":false,"sender":{"key":"nsz@port70.net","avatar":null},"body":"* A. Wilcox <awilfox@adelielinux.org> [2017-01-10 04:36:50 -0600]:\n> On 09/01/17 15:33, Jeff King wrote:\n> > The problem is that we are expecting the regex \"\\x{2b}\" to complain\n> > in regcomp() (as an ERE), but it doesn't. And that probably _is_\n> > related to musl, which is providing the libc regex (I know this\n> > looks like a pcre test, but it's checking that \"-P -E\" overrides\n> > the pcre option with \"-E\").\n> > \n> > I'm not sure if musl is wrong for failing to complain about a\n> > bogus regex. Generally making something that would break into\n> > something that works is an OK way to extend the standard. So our\n> > test is at fault for assuming that the regex will fail. I guess\n\n\\x is undefined in posix and musl is based on tre which\nsupports \\x{hexdigits} in ere.\n\n(i think some bsd platforms use tre as libc regex so\ni'm surprised musl is the first to run into this.)\n\n> > we'd need to find some more exotic syntax that pcre supports, but\n> > that ERE doesn't. Maybe \"(?:)\" or something.\n\ni think you would have to use something that's invalid\nin posix ere, ? after empty expression is undefined,\nnot an error so \"(?:)\" is a valid ere extension.\n\nsince most syntax is either defined or undefined in ere\ninstead of being invalid, distinguishing pcre using\nsyntax is not easy.\n\nthere are semantic differences in subexpression matching:\nleftmost match has higher priority in pcre, longest match\nhas higher priority in ere.\n\n$ echo ab | grep -o -E '(a|ab)'\nab\n$ echo ab | grep -o -P '(a|ab)'\na\n\nunfortunately grep -o is not portable.\n"},{"id":"309205","messageId":"20170111100400.vhd5ytarqpujigbn@sigill.intra.peff.net","threadId":"44800","inReplyTo":"20170110113959.GL17692@port70.net","subject":"Re: [musl] Re: Test failures when Git is built with libpcre and grep is built without it","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2017-01-11T10:04:01Z","receivedAt":"2017-01-11T10:04:11Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Jan 10, 2017 at 12:40:00PM +0100, Szabolcs Nagy wrote:\n\n> > > I'm not sure if musl is wrong for failing to complain about a\n> > > bogus regex. Generally making something that would break into\n> > > something that works is an OK way to extend the standard. So our\n> > > test is at fault for assuming that the regex will fail. I guess\n> \n> \\x is undefined in posix and musl is based on tre which\n> supports \\x{hexdigits} in ere.\n\nThanks for confirming; I figured it was something like that.\n\n> > > we'd need to find some more exotic syntax that pcre supports, but\n> > > that ERE doesn't. Maybe \"(?:)\" or something.\n> \n> i think you would have to use something that's invalid\n> in posix ere, ? after empty expression is undefined,\n> not an error so \"(?:)\" is a valid ere extension.\n\nReading through POSIX[1], hardly anything is explicitly labeled as\n\"invalid\". Most things are just \"undefined\", which leaves rooms for\nimplementations to do what they like.\n\nThat's a good thing for a standard to do, but a bad thing when you are\ntrying to find behavior that differs reliably between PCRE and ERE. :)\nIn most cases, PCRE constructs could be viable extensions to ERE.\n\n> since most syntax is either defined or undefined in ere\n> instead of being invalid, distinguishing pcre using\n> syntax is not easy.\n> \n> there are semantic differences in subexpression matching:\n> leftmost match has higher priority in pcre, longest match\n> has higher priority in ere.\n> \n> $ echo ab | grep -o -E '(a|ab)'\n> ab\n> $ echo ab | grep -o -P '(a|ab)'\n> a\n> \n> unfortunately grep -o is not portable.\n\nIn this case we're testing whether Git has internally fed the regex to\npcre or to regcomp(), not a system grep. So we'd need something like\n\"-o\" for \"git grep\", which I don't think exists.\n\nAnother difference I found is that \"[\\d]\" matches a literal \"\\\" or \"d\"\nin ERE, but behaves like \"[0-9]\" in PCRE. I'll work up a patch based on\nthat.\n\nThanks for your answer. I'll drop the musl list from the cc when I\nfollow-up, as this is most definitely not a musl problem, but a git one.\n\n-Peff\n"},{"id":"309208","messageId":"20170111111055.j3hgijpaabvy6kyg@sigill.intra.peff.net","threadId":"44800","inReplyTo":"20170111100400.vhd5ytarqpujigbn@sigill.intra.peff.net","subject":"[PATCH] t7810: avoid assumption about invalid regex syntax","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2017-01-11T11:10:55Z","receivedAt":"2017-01-11T11:11:07Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"A few of the tests want to check that \"git grep -P -E\" will\noverride -P with -E, and vice versa. To do so, we use a\nregex with \"\\x{..}\", which is valid in PCRE but not defined\nby POSIX (for basic or extended regular expressions).\n\nHowever, POSIX declares quite a lot of syntax, including\n\"\\x\", as \"undefined\". That leaves implementations free to\nextend the standard if they choose. At least one, musl libc,\nimplements \"\\x\" in the same way as PCRE.  Our tests check\nthat \"-E\" complains about \"\\x\", which fails with musl.\n\nWe can fix this by finding some construct which behaves\nreliably on both PCRE and POSIX, but differently in each\nsystem.\n\nOne such construct is the use of backslash inside brackets.\nIn PCRE, \"[\\d]\" interprets \"\\d\" as it would outside the\nbrackets, matching a digit. Whereas in POSIX, the backslash\nmust be treated literally, and we match either it or a\nliteral \"d\".  Moreover, implementations are not free to\nchange this according to POSIX, so we should be able to rely\non it.\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nI've tested this with glibc, but I wasn't able to do so with musl. The\ntwo complications are:\n\n  1. Recent versions of git won't build with musl's regex at all,\n     because it doesn't support the non-standard REG_STARTEND that we\n     rely on since b7d36ffca (regex: use regexec_buf(), 2016-09-21).\n\n     So if applied on an older git, this patch should help, but newer\n     versions need NO_REGEX (to use the fallback glibc regex code)\n     either way, which would also make the problem go away.\n\n     Still, I think it's the right thing to do, since we are relying on\n     something that POSIX clearly leaves up to the implementation. It\n     may also help on other systems, or if musl ends up supporting\n     REG_STARTEND in the future.\n\n  2. I tried to cherry-pick to v2.7.x and test it with musl. Debian\n     ships with a \"musl-gcc\" wrapper, but it doesn't work out of the\n     box. Both zlib and pcre are compiled against glibc, so I'd have to\n     rebuild those, too. At which point I gave up and decided to just\n     let you test it on your musl-based system. :)\n\n t/t7810-grep.sh | 26 +++++++++++++++-----------\n 1 file changed, 15 insertions(+), 11 deletions(-)\n\ndiff --git a/t/t7810-grep.sh b/t/t7810-grep.sh\nindex de2405ccb..19f0108f8 100755\n--- a/t/t7810-grep.sh\n+++ b/t/t7810-grep.sh\n@@ -39,6 +39,10 @@ test_expect_success setup '\n \t\techo \"a+bc\"\n \t\techo \"abc\"\n \t} >ab &&\n+\t{\n+\t\techo d &&\n+\t\techo 0\n+\t} >d0 &&\n \techo vvv >v &&\n \techo ww w >w &&\n \techo x x xx x >x &&\n@@ -1105,36 +1109,36 @@ test_expect_success 'grep pattern with grep.patternType=fixed, =basic, =extended\n '\n \n test_expect_success 'grep -G -F -P -E pattern' '\n-\t>empty &&\n-\ttest_must_fail git grep -G -F -P -E \"a\\x{2b}b\\x{2a}c\" ab >actual &&\n-\ttest_cmp empty actual\n+\techo \"d0:d\" >expected &&\n+\tgit grep -G -F -P -E \"[\\d]\" d0 >actual &&\n+\ttest_cmp expected actual\n '\n \n test_expect_success 'grep pattern with grep.patternType=fixed, =basic, =perl, =extended' '\n-\t>empty &&\n-\ttest_must_fail git \\\n+\techo \"d0:d\" >expected &&\n+\tgit \\\n \t\t-c grep.patterntype=fixed \\\n \t\t-c grep.patterntype=basic \\\n \t\t-c grep.patterntype=perl \\\n \t\t-c grep.patterntype=extended \\\n-\t\tgrep \"a\\x{2b}b\\x{2a}c\" ab >actual &&\n-\ttest_cmp empty actual\n+\t\tgrep \"[\\d]\" d0 >actual &&\n+\ttest_cmp expected actual\n '\n \n test_expect_success LIBPCRE 'grep -G -F -E -P pattern' '\n-\techo \"ab:a+b*c\" >expected &&\n-\tgit grep -G -F -E -P \"a\\x{2b}b\\x{2a}c\" ab >actual &&\n+\techo \"d0:0\" >expected &&\n+\tgit grep -G -F -E -P \"[\\d]\" d0 >actual &&\n \ttest_cmp expected actual\n '\n \n test_expect_success LIBPCRE 'grep pattern with grep.patternType=fixed, =basic, =extended, =perl' '\n-\techo \"ab:a+b*c\" >expected &&\n+\techo \"d0:0\" >expected &&\n \tgit \\\n \t\t-c grep.patterntype=fixed \\\n \t\t-c grep.patterntype=basic \\\n \t\t-c grep.patterntype=extended \\\n \t\t-c grep.patterntype=perl \\\n-\t\tgrep \"a\\x{2b}b\\x{2a}c\" ab >actual &&\n+\t\tgrep \"[\\d]\" d0 >actual &&\n \ttest_cmp expected actual\n '\n \n-- \n2.11.0.627.gfa6151259\n"},{"id":"309229","messageId":"xmqqfukpnwzb.fsf@gitster.mtv.corp.google.com","threadId":"44800","inReplyTo":"20170111100400.vhd5ytarqpujigbn@sigill.intra.peff.net","subject":"Re: [musl] Re: Test failures when Git is built with libpcre and grep is built without it","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-01-11T20:49:12Z","receivedAt":"2017-01-11T20:53:48Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> Another difference I found is that \"[\\d]\" matches a literal \"\\\" or \"d\"\n> in ERE, but behaves like \"[0-9]\" in PCRE. I'll work up a patch based on\n> that.\n\nWow, clever.\n\nThanks.\n"}]}