git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Multiple line ranges and files in line level history browser

From
Bo Yang <struggleyb.nku@gmail.com>
Date
May 11, 2010, 06:16 UTC
Message-ID
<AANLkTim0MUq7JiKQavArUcxZxu7hvXUrO_AdEX6JbcVv@mail.gmail.com>
In-Reply-To
<20100509210654.GA1637@progeny.tock>

Hi, On Mon, May 10, 2010 at 5:06 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:

Show 25 quoted lines
> I like it.  It looks like paranoid script authors would have to check
> for paths like ‘--’ and ‘-L’ and quote them as ‘./--’ and ‘./-L’, a
> small price to pay for a nice syntax.
>
> Unfortunately, this is completely incompatible with the existing blame
> option syntax.  i.e., existing scripts might do things like this:
>
>  git blame -L1,8 -C <file>
>
> or
>
>  git blame -L1,8 <rev> <file>
>
> Maybe there should be a line range required before every file
> specifier in this syntax, to avoid trouble.  Borrowing syntax from sed,
> this makes
>
>  git log <rev> -L1,8 -L45,+6 <file1> -L/some/,/end/ -L9,29 <file2> -L1,$ <file3>
>
> which is also a little clearer to look at, I think.
>
>> 'git log -L1,8 <revision> -- -L1,8' .
>
> This provides a single line range specifier for all files?  Sounds
> convenient.

Ah, I don't mean that... I just want to provide a way to let the users view the line range history of files like '-L1,8'. But since you remind me users can always use 'log -L1,8 ./-L1,8' to do this, I think we should abandon this kind of syntax.

>  # who wrote the opening comments?
>  git blame -L '/^[/][*]/,/^ [*][/]/' -- '*.c'

I think users can always use a little shell script to achieve this, we should not bother to implement such a complex thing which can be easily done by shell script.

Regards! Bo

-- 
My blog: http://blog.morebits.org
Previous: Bo YangNext: Jonathan Nieder
Message 8 of 9 in “Multiple line ranges and files in line level history browser”
  1. Bo YangMay 9, 2010
  2. Junio C HamanoMay 9, 2010
  3. Bo YangMay 11, 2010
  4. Thomas RastMay 12, 2010
  5. Jonathan NiederMay 9, 2010
  6. Jonathan NiederMay 10, 2010
  7. Bo YangMay 11, 2010
  8. Bo YangMay 11, 2010
  9. Jonathan NiederMay 11, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.