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

grep issues

From
Orgad Shaneh <orgads@gmail.com>
Date
Nov 11, 2018, 13:17 UTC
Message-ID
<CAGHpTB+fQccqR8SF2_dS3itboKd79238KCFRe4-3PZz6bpr3iQ@mail.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
Next: Torsten Bögershausen
Message 1 of 2 in “grep issues”
  1. Orgad ShanehNov 11, 2018
  2. Torsten BögershausenNov 20, 2018

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.