From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: git@vger.kernel.org
Cc: "Junio C Hamano" <gitster@pobox.com>,
"Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
Subject: [BUG?] blame: Odd -L 1,+0 behavior
Date: Fri, 16 Jul 2010 15:50:52 +0000 [thread overview]
Message-ID: <AANLkTin-6nck9aVKPTwOy_PmrGUs1iS8ruqzIORbf8jb@mail.gmail.com> (raw)
On Fri, Jul 16, 2010 at 15:35, Ævar Arnfjörð Bjarmason <avarab@gmail.com> wrote:
> git-pickaxe (later git-blame) gained support for the -L/start/,/end/
> form in 2006 (931233bc66 by Junio C Hamano), but nothing was added to
> test this functionality. Change that by adding more -L tests to
> t8003-blame.sh.
I was also going to patch t8003-blame.sh to test for the functionality
introduced in 7bd9641df5, but I'm not sure what it's supposed to do:
ok:
$ git blame cow
5b22ca36 (Fourth 2005-04-07 15:16:13 -0700 1) ABC
5b22ca36 (Fourth 2005-04-07 15:16:13 -0700 2) DEF
018e3134 (Fifth 2005-04-07 15:17:13 -0700 3) XXXX
5b22ca36 (Fourth 2005-04-07 15:16:13 -0700 4) GHIJK
ok:
$ git blame -L 1,2 cow
5b22ca36 (Fourth 2005-04-07 15:16:13 -0700 1) ABC
5b22ca36 (Fourth 2005-04-07 15:16:13 -0700 2) DEF
ok, +/- are zero-indexed:
$ git blame -L 1,+2 cow
5b22ca36 (Fourth 2005-04-07 15:16:13 -0700 1) ABC
5b22ca36 (Fourth 2005-04-07 15:16:13 -0700 2) DEF
Shouldn't this either print nothing, er be an error:
$ git blame -L 1,+0 cow
5b22ca36 (Fourth 2005-04-07 15:16:13 -0700 1) ABC
5b22ca36 (Fourth 2005-04-07 15:16:13 -0700 2) DEF
same here, line 0-0 prints the whole file:
$ git blame -L 0,0 cow
5b22ca36 (Fourth 2005-04-07 15:16:13 -0700 1) ABC
5b22ca36 (Fourth 2005-04-07 15:16:13 -0700 2) DEF
018e3134 (Fifth 2005-04-07 15:17:13 -0700 3) XXXX
5b22ca36 (Fourth 2005-04-07 15:16:13 -0700 4) GHIJK
And these need a better error message:
$ git blame -L 0,0a cow
usage: git blame [options] [rev-opts] [rev] [--] file
Is there any use for +/- 0, or should it always be an error?
next reply other threads:[~2010-07-16 15:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-16 15:50 Ævar Arnfjörð Bjarmason [this message]
2010-07-16 21:11 ` [BUG?] blame: Odd -L 1,+0 behavior Junio C Hamano
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=AANLkTin-6nck9aVKPTwOy_PmrGUs1iS8ruqzIORbf8jb@mail.gmail.com \
--to=avarab@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/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).