git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: Aidan Van Dyk <aidan@highrise.ca>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] git-grep: Add ability to limit directory recursion
Date: Wed, 7 May 2008 03:34:17 +0200	[thread overview]
Message-ID: <200805070334.18500.jnareb@gmail.com> (raw)
In-Reply-To: <20080507004719.GJ18081@yugib.highrise.ca>

Aidan Van Dyk wrote:
> * Jakub Narebski <jnareb@gmail.com> [080506 20:34]:
>> Aidan Van Dyk <aidan@highrise.ca> writes:
>> 
>>> This add a -R <limit> option to git-grep which will limit the depth of the
>>> directories recursed when git is doing a grep.
>>> 
>>> This allows you to do something like:
>>>         git grep -R 1 <pattern>
>>> and see only the results of the grep on files in the current directory.
>>> 
>>> It defaults to a limit of "0" which disables the limiting.
>> 
>> Nice idea, although I'm not sure if we shouldn't borrow "-maxdepth"
>> option from GNU find and friends...
> 
> Good idea - I hadn't thought of that, but I like it better.

Note that GNU find uses non-standard single-dash long options, and
that "-maxdepth 0" means do not recurse, but use only files provided
as arguments.

GNU wget on the other hand uses -l DEPTH/--level=DEPTH, and uses -l 0
(or -l inf) as in your patch, i.e. infinite recursion.

-- 
Jakub Narebski
Poland

      reply	other threads:[~2008-05-07  1:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-06 17:18 [PATCH] git-grep: Add ability to limit directory recursion Aidan Van Dyk
2008-05-07  0:34 ` Jakub Narebski
2008-05-07  0:47   ` Aidan Van Dyk
2008-05-07  1:34     ` Jakub Narebski [this message]

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

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

  git send-email \
    --in-reply-to=200805070334.18500.jnareb@gmail.com \
    --to=jnareb@gmail.com \
    --cc=aidan@highrise.ca \
    --cc=git@vger.kernel.org \
    /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.
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 NNTP newsgroup(s).