Re: [BUG?] blame: Odd -L 1,+0 behavior

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx> writes:

> ok, +/- are zero-indexed:
>
>     $ git blame -L 1,+2 cow

I don't know what "zero-indexed" means, but +2 means "starting from the
line I told you earlier, give me two lines".  Likewise -2 means "ending at
the line I told you earlier, give me two lines".  As a side effect of the
internal implementation of this logic -L 5,3 means the same thing as -L 3,5
but that is not an intended nor documented behaviour.

> Shouldn't this either print nothing, er be an error:
(multiple)

The parsing code is lax in the sense that rejecting nonsensical input like
"-L 10,-100" and "-L 2,+0" as an error was not considered a primary goal.
The only error checking it does is to make sure it does not parse numbers
that it cannot use (i.e. start from line 30 in a file that does not have
that many lines).

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]