• M
    grep: Add --max-depth option. · a91f453f
    Michał Kiedrowicz 提交于
    It is useful to grep directories non-recursively, e.g. when one wants to
    look for all files in the toplevel directory, but not in any subdirectory,
    or in Documentation/, but not in Documentation/technical/.
    
    This patch adds support for --max-depth <depth> option to git-grep. If it is
    given, git-grep descends at most <depth> levels of directories below paths
    specified on the command line.
    
    Note that if path specified on command line contains wildcards, this option
    makes no sense, e.g.
    
        $ git grep -l --max-depth 0 GNU -- 'contrib/*'
    
    (note the quotes) will search all files in contrib/, even in
    subdirectories, because '*' matches all files.
    
    Documentation updates, bash-completion and simple test cases are also
    provided.
    Signed-off-by: NMichał Kiedrowicz <michal.kiedrowicz@gmail.com>
    Signed-off-by: NJunio C Hamano <gitster@pobox.com>
    a91f453f
git-grep.txt 4.6 KB