Re: [PATCH/RFC 0/4] grep: support to match by line number

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 2, 2011 at 18:38, Junio C Hamano <gitster@xxxxxxxxx> wrote:
> I am personally not thrilled by what this series attempts to do, but first
> a few questions:
>
> Â- Are there existing non-git "grep" implementations that do this?

I didn't know of any, until Jakub mentioned the ack tool. And I didn't
look for one. I will answer you 'yes'-questions only in context of my
proposal.

>
> Â- If yes:
> Â - what command option letter do they use to specify line number?

I have no strong argument for -@, it was short and -l and -L are
taken, but I wont use this that often on the command line, so a long
option like '--line=' is ok for me too.

> Â - do they not support a range notation (e.g. -@ 25-30,32-40)?

That was already on my todo list and also mentioned in the last paragraph.

> Â - what do they do when given more than one file?

Like the content patterns, they try to match.

>
> Â- If no:
> Â - why not? ÂIs it a sign that this is ill-thought out misfeature?

Printing only some lines of a file isn't that hard, and there are
obviously some standard tools which do this fine, but combining this
with the -C and --show-function feature isn't easy. So extending grep
with this feature sounds like the best bet.

> Â - perhaps people use something like "sed -n -e 25,30p file" and be
> Â Â happy?

How would you combine this with git grep HEAD or with multiple files?

Bert
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]