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