git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG?] blame: Odd -L 1,+0 behavior
@ 2010-07-16 15:50 Ævar Arnfjörð Bjarmason
  2010-07-16 21:11 ` Junio C Hamano
  0 siblings, 1 reply; 4+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2010-07-16 15:50 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

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?

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-07-16 22:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-16 15:50 [BUG?] blame: Odd -L 1,+0 behavior Ævar Arnfjörð Bjarmason
2010-07-16 21:11 ` Junio C Hamano
2010-07-16 21:25   ` Ævar Arnfjörð Bjarmason
2010-07-16 22:33     ` Junio C Hamano

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).