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

Re: [PATCH/RFC 0/4] grep: support to match by line number

From
Junio C Hamano <gitster@pobox.com>
Date
May 2, 2011, 19:08 UTC
Message-ID
<7vy62oly2h.fsf@alter.siamese.dyndns.org>
In-Reply-To
<BANLkTinVvJgE0+gxm8SdDi30-a11P2HnNA@mail.gmail.com>
Bert Wesarg <bert.wesarg@googlemail.com> writes:
Show 5 quoted lines
>>  - Are there existing non-git "grep" implementations that do this?
>
> I didn't know of any, until Jakub mentioned the ack tool. And I didn't
> look for one. I will answer you 'yes'-questions only in context of my
> proposal.

Thanks, but these questions are simple sanity checks done by contrasting your design with _existing practices_, if any. It is not useful to answer what you did here, only to contrast your design with itself.

Also we can read them from your implementation ;-).
>>   - perhaps people use something like "sed -n -e 25,30p file" and be
>>     happy?
>
> How would you combine this with git grep HEAD or with multiple files?

Now how did you get the compiler error messages from your example from the files in HEAD commit without checking them out?

Besides, that question is still part of figuring out prior art done in the git-unaware grep, so it is irrelevant that sed or other people's grep cannot peek into HEAD.

Previous: Bert WesargNext: Bert Wesarg
Message 21 of 22 in “grep: support to match by line number”
  1. 0/4 grep: support to match by line numberBert Wesarg, May 2, 2011
  2. 1/4 grep: prepare for re-using the space of the regexp member in struct grep_patBert Wesarg, May 2, 2011
  3. 2/4 grep: pass current line number down to match_one_patternBert Wesarg, May 2, 2011
  4. 3/4 grep: introduce pattern which matches at line numberBert Wesarg, May 2, 2011
  5. 4/4 grep: provide option to match line numberBert Wesarg, May 2, 2011
  6. Thiago FarinaMay 2, 2011
  7. Bert WesargMay 2, 2011
  8. Thiago FarinaMay 2, 2011
  9. Bert WesargMay 2, 2011
  10. Junio C HamanoMay 2, 2011
  11. Thiago FarinaMay 2, 2011
  12. Bert WesargMay 2, 2011
  13. Sverre RabbelierMay 2, 2011
  14. Bert WesargMay 2, 2011
  15. Junio C HamanoMay 2, 2011
  16. Bert WesargMay 2, 2011
  17. Junio C HamanoMay 2, 2011
  18. Junio C HamanoMay 2, 2011
  19. Jakub NarebskiMay 2, 2011
  20. Bert WesargMay 2, 2011
  21. Junio C HamanoMay 2, 2011
  22. Bert WesargMay 2, 2011

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.