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

Re: [PATCH/RFC] blame: accept multiple -L ranges

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 22, 2013, 17:23 UTC
Message-ID
<7vr4eqcxub.fsf@alter.siamese.dyndns.org>
In-Reply-To
<87r4er2ct4.fsf@linux-k42r.v.cablecom.net>
Thomas Rast <trast@inf.ethz.ch> writes:
Show 17 quoted lines
> Eric Sunshine <sunshine@sunshineco.com> writes:
>
>> The proposal currently is only for "-L /RE/,whatever" to behave in a
>> relative fashion, beginning the search at the end of the last range
>> specified via -L (or line 1 if there is no previous -L).
>>
>> Would it also make sense to support "-L +N,whatever" as relative to
>> the end of the last range specified via -L (or 1 if none).
>
> Sounds reasonable.
>
> I'm still not sure I am super-happy with /RE/ always being relative,
> though I see Junio's problem space as something worth solving.  How does
> it interact with -L:RE?  Do you now have to know in what order the
> functions appear in the source to correctly specify -L:foo -L:bar or
> similarly, -L/foo/,/^}/ -L/bar/,/^}/?  What if we supported +/RE/ as the
> relative version?
Two gripes I have are:
 (1) That sounds like making common things more cumbersome to ask.
 (2) In "-L /RE1/,/RE2/", you do not have to say +/RE2/ (and you
     shouldn't have to).  /RE3/ without any magic that starts
     searching after the last match in "-L /RE1/,/RE2/ -L /RE3/,+4"
     feels a lot more consistent than requiring a prefix plus.

I am OK if you made /RE/, which starts searching immediately after the last match, wrap around and continue the search at the beginning upon finding nothing through the end of the file (and make sure you stop if you passed the last match again). That would solve your "I have two functions, and I can give them in any order", while keeping the consistency with "In /RE1/,/RE2/, the latter is already relative to the former".

Previous: Thomas RastNext: Thomas Rast
Message 17 of 22 in “blame: accept multiple -L ranges”
  1. blame: accept multiple -L rangesEric Sunshine, Jul 7, 2013
  2. Junio C HamanoJul 7, 2013
  3. Eric SunshineJul 9, 2013
  4. Junio C HamanoJul 9, 2013
  5. Eric SunshineJul 9, 2013
  6. Thomas RastJul 9, 2013
  7. Eric SunshineJul 9, 2013
  8. Junio C HamanoJul 9, 2013
  9. Eric SunshineJul 9, 2013
  10. Thomas RastJul 9, 2013
  11. Jonathan NiederJul 9, 2013
  12. Junio C HamanoJul 9, 2013
  13. Michael HaggertyJul 9, 2013
  14. Junio C HamanoJul 9, 2013
  15. Eric SunshineJul 22, 2013
  16. Thomas RastJul 22, 2013
  17. Junio C HamanoJul 22, 2013
  18. Thomas RastJul 22, 2013
  19. Junio C HamanoJul 22, 2013
  20. Thomas RastJul 10, 2013
  21. Junio C HamanoJul 11, 2013
  22. Junio C HamanoJul 9, 2013

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.