hg grep users, feedback wanted
Martin Geisler
mg at aragost.com
Wed May 19 08:32:14 UTC 2010
Masklinn <masklinn at masklinn.net> writes:
> On 2010-05-18, at 17:50 , Steve Borho wrote:
>> On Tue, May 18, 2010 at 10:35 AM, Masklinn <masklinn at masklinn.net> wrote:
>>> On 2010-05-18, at 17:25 , Steve Borho wrote:
>>>>
>>>> Proposed change:
>>>>
>>>> 'hg grep foo' will scan the working copy for matches (10x faster
>>>> than current behavior)
>>>
>>> I really don't see the point of that one. If I want to grep the
>>> working copy I have `grep` (or even better, `ack`).
>>>
>>> As far as I'm concerned, hg grep is to find something I've lost
>>> somewhere in my history, if it's already here I can trivially find
>>> it without needing hg to do so. That would make a "bare" invocation
>>> of hg grep pretty much useless.
>>
>> Not having to filter out build garbage and other cruft is quite
>> useful; and as I replied separately, grep is not always available. I
>> think this is the behavior new users expect when they use 'hg grep'
>
> All I can say is that it never was the behavior I expected when I
> first discovered a grep built into my VCS, I would have found that not
> very useful.
I agree, I also think 'hg grep' should search through history by
default. New users wont even recognize the command from its name, and if
they do recognize the name, well then they can use/install a real grep.
We may want to look at 'hg cat', another command which has it's name
from a popular Unix command. Doing 'hg cat foo' will show the file as it
was commited in the working copy parent revision, not as it currently
looks on disk. I guess everybody will agree that making 'hg cat' output
the file as it is on disk seems redundant and so I don't think 'hg grep'
should do that either.
--
Martin Geisler
aragost Trifork
Professional Mercurial support
http://aragost.com/mercurial/
More information about the Mercurial
mailing list