git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* grep issues
@ 2018-11-11 13:17 Orgad Shaneh
  2018-11-20  5:21 ` Torsten Bögershausen
  0 siblings, 1 reply; 2+ messages in thread
From: Orgad Shaneh @ 2018-11-11 13:17 UTC (permalink / raw)
  To: git

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: grep issues
  2018-11-11 13:17 grep issues Orgad Shaneh
@ 2018-11-20  5:21 ` Torsten Bögershausen
  0 siblings, 0 replies; 2+ messages in thread
From: Torsten Bögershausen @ 2018-11-20  5:21 UTC (permalink / raw)
  To: Orgad Shaneh; +Cc: git

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 ?

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-11-20  5:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-11 13:17 grep issues Orgad Shaneh
2018-11-20  5:21 ` Torsten Bögershausen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).