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

Re: [PATCH] grep: provide pathspecs/patterns via file or stdin

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 22, 2019, 02:24 UTC
Message-ID
<xmqq1ru08x80.fsf@gitster-ct.c.googlers.com>
In-Reply-To
<20191122011646.218346-1-emilyshaffer@google.com>
Emily Shaffer <emilyshaffer@google.com> writes:
> Teach 'git grep' how to receive pathspecs via file, and add convenience
> flags for receiving pathspecs or patterns via stdin.

When I invented the terms "pathspec", "refspec", etc. for this project, I meant them to be collective nouns. A pathspec is a set of pathspec elements, each of which is usually given as a separate argument on the command line. So "Read pathspec from file" is good (not "Read pathspecs from file").

Are you aware of the am/pathspec-from-file topic that has been cooking for a while by now?

I do not necessarily agree with the second rationale why many commands may want to learn this option given in that series, but do agree with the first one. A lot of times running underlying "git" command multiple times via xargs invocation can mean quite different thing from giving a large pathspec to a single invocation of "git". But not with "git grep" ;-) So I'd say this is a second class target for the pathspec-from-file theme.

Thanks.
Previous: Junio C HamanoNext: Emily Shaffer
Message 9 of 23 in “grep: provide pathspecs/patterns via file or stdin”
  1. grep: provide pathspecs/patterns via file or stdinEmily Shaffer, Nov 22, 2019
  2. Denton LiuNov 22, 2019
  3. Junio C HamanoNov 22, 2019
  4. Junio C HamanoNov 22, 2019
  5. Denton LiuNov 22, 2019
  6. Emily ShafferNov 22, 2019
  7. Emily ShafferNov 22, 2019
  8. Junio C HamanoNov 23, 2019
  9. Junio C HamanoNov 22, 2019
  10. grep: support the --pathspec-from-file optionEmily Shaffer, Dec 4, 2019
  11. Denton LiuDec 4, 2019
  12. Junio C HamanoDec 4, 2019
  13. Junio C HamanoDec 4, 2019
  14. Emily ShafferDec 13, 2019
  15. Alexandr MiloslavskiyDec 5, 2019
  16. Emily ShafferDec 13, 2019
  17. Johannes SchindelinDec 6, 2019
  18. SZEDER GáborDec 6, 2019
  19. grep: support the --pathspec-from-file optionEmily Shaffer, Dec 13, 2019
  20. Alexandr MiloslavskiyDec 13, 2019
  21. Junio C HamanoDec 13, 2019
  22. Alexandr MiloslavskiyDec 13, 2019
  23. Emily ShafferDec 17, 2019

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.