From: Junio C Hamano <gitster@pobox.com>
To: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Cc: git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [BUG?] blame: Odd -L 1,+0 behavior
Date: Fri, 16 Jul 2010 14:11:34 -0700 [thread overview]
Message-ID: <7vy6dbqghl.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <AANLkTin-6nck9aVKPTwOy_PmrGUs1iS8ruqzIORbf8jb@mail.gmail.com> ("Ævar Arnfjörð Bjarmason"'s message of "Fri\, 16 Jul 2010 15\:50\:52 +0000")
Ævar Arnfjörð Bjarmason <avarab@gmail.com> 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).
next prev parent reply other threads:[~2010-07-16 21:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-16 15:50 [BUG?] blame: Odd -L 1,+0 behavior Ævar Arnfjörð Bjarmason
2010-07-16 21:11 ` Junio C Hamano [this message]
2010-07-16 21:25 ` Ævar Arnfjörð Bjarmason
2010-07-16 22:33 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vy6dbqghl.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=avarab@gmail.com \
--cc=git@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).