Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: gclient.py

Issue 11270056: Add gclient grep for git repos (Closed) Base URL: https://git.chromium.org/chromium/tools/depot_tools.git@master
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gclient.py
diff --git a/gclient.py b/gclient.py
index a91c61b32bf45253a9bedf9a8f39b909ec317bdb..3d086e261dfb9de4a2bfaddca5ec3073e200f90e 100644
--- a/gclient.py
+++ b/gclient.py
@@ -1250,6 +1250,22 @@ Completely git-specific. Simply runs 'git fetch [args ...]' for each module.
args = ['-j%d' % options.jobs, '-s', 'git', 'git', 'fetch'] + args
return CMDrecurse(parser, args)
M-A Ruel 2012/10/26 12:45:42 2 lines
Isaac (away) 2012/11/05 07:08:49 Done.
+@attr('usage', '[args ...]')
+def CMDgrep(parser, args):
+ """Greps through git repos managed by gclient.
+
+Runs 'git grep [args ...]' for each module.
+"""
+ parser.disable_interspersed_args()
+ parser.set_defaults(jobs=1)
M-A Ruel 2012/10/26 12:45:42 I think it'd be preferable to remove the option wi
Isaac (away) 2012/11/05 07:08:49 I'd like to leave this option available in some fo
+ parser.add_option('--color', default='Always',
+ help='--color param passed to git grep, default=Always')
+ (options, args) = parser.parse_args(args)
+ print 'jobs', options.jobs
+ args = ['-j%d' % options.jobs, '-i', '-s', 'git', 'git', 'grep',
M-A Ruel 2012/10/26 12:45:42 '-jobs', '1', '--ignore', '--scm', 'git', ... Can
Isaac (away) 2012/11/05 07:08:49 Done. I was copying CMDfetch from above. I've up
+ '--color=%s' % options.color] + args
+ return CMDrecurse(parser, args)
+
@attr('usage', '[url] [safesync url]')
def CMDconfig(parser, args):
@@ -1571,7 +1587,7 @@ def Parser():
gclientfile_default = os.environ.get('GCLIENT_FILE', '.gclient')
parser.add_option('-j', '--jobs', default=jobs, type='int',
help='Specify how many SCM commands can run in parallel; '
- 'defaults to number of cpu cores (%default)')
+ 'default=%default')
M-A Ruel 2012/10/26 12:45:42 Don't change here.
Isaac (away) 2012/11/05 07:08:49 Done.
parser.add_option('-v', '--verbose', action='count', default=0,
help='Produces additional output for diagnostics. Can be '
'used up to three times for more logging info.')
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698