# grep issues

2 messages from 2018-11-11 to 2018-11-20. Participants: Orgad Shaneh, Torsten Bögershausen.
Thread: https://gitlist.dev/t/49802

## Orgad Shaneh, 2018-11-11 13:17

Subject: grep issues
Message-ID: <CAGHpTB+fQccqR8SF2_dS3itboKd79238KCFRe4-3PZz6bpr3iQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAGHpTB%2BfQccqR8SF2_dS3itboKd79238KCFRe4-3PZz6bpr3iQ%40mail.gmail.com

```
Hi,

I found 2 bugs in grep, using Git for Windows 2.19.1 (but noticed
these several versions ago):

1. git grep --recursive on a worktree (without rev) always matches
against the submodule's HEAD, not its worktree, as it should.
2. When core.autocrlf (or eol=crlf) is used, and a file in the
worktree has CRLF, git grep fails to match $ against EOL.

For example:
git init
echo 'file eol=crlf' > .gitattributes
echo ABCD > file
git add file
git commit -m 'CRLF'
rm file
git checkout -f file
git grep 'D$' file # Nothing
git grep 'D$' HEAD -- file # Found!

- Orgad

```

## Torsten Bögershausen, 2018-11-20 05:21

Subject: Re: grep issues
Message-ID: <20181120052154.GB16814@tor.lan>
URL: https://gitlist.dev/e/20181120052154.GB16814%40tor.lan
In-Reply-To: <CAGHpTB+fQccqR8SF2_dS3itboKd79238KCFRe4-3PZz6bpr3iQ@mail.gmail.com>

```
On Sun, Nov 11, 2018 at 03:17:50PM +0200, Orgad Shaneh wrote:
> Hi,
> 
> I found 2 bugs in grep, using Git for Windows 2.19.1 (but noticed
> these several versions ago):
> 
> 1. git grep --recursive on a worktree (without rev) always matches
> against the submodule's HEAD, not its worktree, as it should.
> 2. When core.autocrlf (or eol=crlf) is used, and a file in the
> worktree has CRLF, git grep fails to match $ against EOL.
> 
> For example:
> git init
> echo 'file eol=crlf' > .gitattributes
> echo ABCD > file
> git add file
> git commit -m 'CRLF'
> rm file
> git checkout -f file
> git grep 'D$' file # Nothing
> git grep 'D$' HEAD -- file # Found!
> 
> - Orgad

I can confirm the "2. When core.autocrlf" bug, or should we call
it a non-implemented feature.
It seems as if a convert_to_git() is needed in grep.c,
but I haven't found the time to dig deeper.
Does anybody wants to work on this ?

```
