git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Eric Sunshine <sunshine@sunshineco.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Git List <git@vger.kernel.org>, Thomas Rast <trast@inf.ethz.ch>
Subject: Re: [PATCH/RFC] blame: accept multiple -L ranges
Date: Tue, 9 Jul 2013 13:17:18 -0400	[thread overview]
Message-ID: <CAPig+cSxiSWwZ6QANWtTt7ioAewD0tk62V=pkdiT9JLw3Fzb9g@mail.gmail.com> (raw)
In-Reply-To: <7v38rnwuvb.fsf@alter.siamese.dyndns.org>

On Tue, Jul 9, 2013 at 12:39 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Eric Sunshine <sunshine@sunshineco.com> writes:
>
>> As implemented by this patch, the behavior of git-blame with multiple
>> -L's is consistent with that of git-log with multiple -L's. The
>> implemented behavior feels intuitive to me, but I can see how the
>> behavior you suggest could feel intuitive to others.
>>
>> If I re-do the patch to work the way you describe above, how should we
>> deal with the inconsistent behaviors between the two commands?
>
> The suggestion to error out was more about "start simple, strict and
> obvious to make it easy to explain" and nothing else.  If we start
> with a simple and strict version, we can later loosen it without
> making an input that was valid earlier invalid.  If we start with
> too loose, on the other hand, it would be hard to tighten it later.

Makes sense.

> But the only two things I care deeply about are, in a file whose
> contents is:
>
>         C
>         B
>         A
>         B
>         C
>         D
>
>  (1) The range "-L /A/,/B/" finds the first A from the beginning,
>      and then chooses B that comes _after_ it, making it equivalent
>      to -L3,4 (not -L3,2 or -L2,3).
>
>  (2) In the ranges "-L <anything>,/B/ -L /C/,<anything>", the
>      beginning of the second range is found by choosing C that comes
>      _after_ the end of the previous range (/B/ may choose either
>      the second or the 4th line, and the only C that comes after
>      either of them is the 5th line and that is where the second
>      range should begin, not at the beginning of the file).  The
>      same for "-L 1,3 -L /C/" (only C that comes after 3 is eligible
>      to be the beginning of the second range).

Thinking aloud: Thus, for "-L 1,5 -L /C/", no C would be found.

> I view it as a nice addition to coalesce two overlapping ranges
> given exactly by numbers, e.g. "-L 100,200 -L 50,102".  I do not
> have a strong objection to it, as long as it does not interfere
> negatively with ranges specified by patterns.

Okay, I will base my rewrite upon the above constraints, along with
other observations from your initial response.

-- ES

  reply	other threads:[~2013-07-09 17:17 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-07  8:45 [PATCH/RFC] blame: accept multiple -L ranges Eric Sunshine
2013-07-07  9:58 ` Junio C Hamano
2013-07-09 15:04   ` Eric Sunshine
2013-07-09 16:39     ` Junio C Hamano
2013-07-09 17:17       ` Eric Sunshine [this message]
2013-07-09 17:42       ` Thomas Rast
2013-07-09 18:23         ` Eric Sunshine
2013-07-09 18:55           ` Junio C Hamano
2013-07-09 19:07             ` Eric Sunshine
2013-07-09 19:12             ` Thomas Rast
2013-07-09 19:21               ` Jonathan Nieder
2013-07-09 19:31               ` Junio C Hamano
2013-07-09 19:57                 ` Michael Haggerty
2013-07-09 20:25                   ` Junio C Hamano
2013-07-22  8:12                     ` Eric Sunshine
2013-07-22 10:39                       ` Thomas Rast
2013-07-22 17:23                         ` Junio C Hamano
2013-07-22 19:19                           ` Thomas Rast
2013-07-22 21:34                             ` Junio C Hamano
2013-07-10  9:18                 ` Thomas Rast
2013-07-11 16:44                   ` Junio C Hamano
2013-07-09 18:57         ` 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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAPig+cSxiSWwZ6QANWtTt7ioAewD0tk62V=pkdiT9JLw3Fzb9g@mail.gmail.com' \
    --to=sunshine@sunshineco.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=trast@inf.ethz.ch \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).