Re: [PATCH v2] blame: prevent error if range ends past end of file
- From
Isabella Stephens <istephens@atlassian.com>
- Date
- Oct 26, 2017, 22:50 UTC
- Message-ID
- <f22b2cda-745b-ee00-2578-cf5cec13d050@atlassian.com>
- In-Reply-To
- <CA+P7+xpk+9R9kMGNky4vTRpASf_nXM1xt0KHFjqwn8aB1NzDAQ@mail.gmail.com>
On 26/10/17 7:48 pm, Jacob Keller wrote:
Show 20 quoted lines
> On Thu, Oct 26, 2017 at 12:01 AM, Isabella Stephens > <istephens@atlassian.com> wrote: >> If the -L option is used to specify a line range in git blame, and the >> end of the range is past the end of the file, at present git will fail >> with a fatal error. This commit prevents such behaviour - instead the >> blame is display for any existing lines within the specified range. >> >> Signed-off-by: Isabella Stephens <istephens@atlassian.com> >> --- > > I like this change. We might want to document L to indicate that an L > that is outside the range of lines will show all lines that do match. > > Maybe we also want it to only succeed if at least some lines are > blamed? Could we make it so that it fails if no lines are within the > range? (ie: the start point is too far in? or does it already do > such?) > > Thanks, > Jake
Yep, that is exactly how it behaves now - if a range intersects the file at all it will annotate the relevant lines, otherwise it will fail.
I'll add a clarification to the documentation in my next revision. Thanks for reviewing!