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

Re: [PATCH] builtin-grep: workaround for non GNU grep.

From
Junio C Hamano <junkio@cox.net>
Date
May 17, 2006, 18:59 UTC
Message-ID
<7vodxwcwa1.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.64.0605171109170.10823@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> writes:
Show 13 quoted lines
> I think this is portable and correct.
>
> Of course, it still ignores the fact that not all grep's support some of 
> the flags like -F/-L/-A/-C etc, but for those cases, the external grep 
> itself will happily just say "unrecognized option -F" or similar.
>
> So with this change, "git grep" should handle all the flags the native 
> grep handles, which is really quite fine. We don't _need_ to expose 
> anything more, and if you do want our extensions, you can get them with 
> "--uncached" and an up-to-date index.
>
> No configuration necessary, and we automatically take advantage of any 
> native grep we have, if possible.
This makes -c misbehave in a subtle way.
	git grep -c -e no-such-string-anywhere | head -n 1
But I do not think we care.
Previous: Linus TorvaldsNext: Linus Torvalds
Message 31 of 36 in “Git 1.3.2 on Solaris”
  1. Stefan PfetzingMay 16, 2006
  2. Jason RiedyMay 17, 2006
  3. Linus TorvaldsMay 17, 2006
  4. Jason RiedyMay 17, 2006
  5. Linus TorvaldsMay 17, 2006
  6. Stefan PfetzingMay 17, 2006
  7. Linus TorvaldsMay 17, 2006
  8. Stefan PfetzingMay 17, 2006
  9. Linus TorvaldsMay 17, 2006
  10. Jason RiedyMay 17, 2006
  11. Stefan PfetzingMay 23, 2006
  12. Jason RiedyMay 23, 2006
  13. Stefan PfetzingMay 23, 2006
  14. Linus TorvaldsMay 23, 2006
  15. Edgar ToernigMay 23, 2006
  16. Linus TorvaldsMay 23, 2006
  17. Edgar ToernigMay 23, 2006
  18. Jason RiedyMay 23, 2006
  19. Linus TorvaldsMay 23, 2006
  20. Linus TorvaldsMay 23, 2006
  21. Stefan PfetzingMay 26, 2006
  22. Ryan AndersonMay 17, 2006
  23. Junio C HamanoMay 17, 2006
  24. Junio C HamanoMay 17, 2006
  25. builtin-grep: workaround for non GNU grep.Junio C Hamano, May 17, 2006
  26. Linus TorvaldsMay 17, 2006
  27. Junio C HamanoMay 17, 2006
  28. Bertrand JacquinMay 17, 2006
  29. Junio C HamanoMay 17, 2006
  30. Linus TorvaldsMay 17, 2006
  31. Junio C HamanoMay 17, 2006
  32. Linus TorvaldsMay 17, 2006
  33. Junio C HamanoMay 17, 2006
  34. Stefan PfetzingMay 17, 2006
  35. Junio C HamanoMay 17, 2006
  36. Stefan PfetzingMay 17, 2006

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.