On 07/09/2013 09:31 PM, Junio C Hamano wrote:
> Thomas Rast <[email protected]> writes:
>
>> If you define it that way, the output of
>>
>> git blame -L 4,6; git blame -L /A/,+20
>>
>> is significantly different from
>>
>> git blame -L 4,6 -L /A/,+20
>>
>> Not just in the presentation or any possible coalescing, but in the
>> meaning of the ranges.
>>
>> Do you really want to make it that way?
>
> Absolutely. The primary reason I want to be able to specify two
> ranges at the same time is to follow two functions in a file that
> appear in separate places, and /A/ might not be unique. When I want
> to say "I want to see from here to there, and then from here to
> there, and then from here to there", it would be very frustrating if
> "and then" resets what I mean by "here" every time and make these
> three evaluated independently.
It would be more general to support "follow the second match to /A/"
*independent* of whether the first match is also followed. I think your
proposal only allows the second to be followed if the first is also
followed. Therefore it seems to me that your wish is to add a
side-effect to one feature so that you can use it to obtain a simulacrum
of a second feature, instead of building the second feature directly.
Perhaps allow <start> and <end> to be a sequence of forms like
/A//A/,+20
Start at the second occurrence of /A/ an continue for 20 lines
/A/+20,/B/
Start 20 lines after the first match of /A/ until the subsequent
match of /B/
E.g., the body of function "foo" would be '/^int foo//^{/+1,/^}/-1'.
That should provide hours of amusement to baffled users ;-)
Michael
--
Michael Haggerty
[email protected]
http://softwareswirl.blogspot.com/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html