aboutsummaryrefslogtreecommitdiff
path: root/builtin.h
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-04-30 23:28:15 -0700
committerJunio C Hamano <junkio@cox.net>2006-05-01 01:26:46 -0700
commit5010cb5fcca30269ad25f2eb38b31455af3205d7 (patch)
tree7ec4dfd393fba892fd3fa1838100974ea54d3155 /builtin.h
parent66ae0c7702e68765dad17aa05c5d9255d999216c (diff)
downloadgit-5010cb5fcca30269ad25f2eb38b31455af3205d7.tar.gz
git-5010cb5fcca30269ad25f2eb38b31455af3205d7.tar.xz
built-in "git grep"
This attempts to set up built-in "git grep" to further reduce our dependence on the shell, while at the same time optionally allowing to run grep against object database. You could do funky things like these: git grep --cached -e pattern ;# grep from index git grep -e pattern master ;# or in a rev git grep -e pattern master next ;# or in multiple revs git grep -e pattern pu^@ ;# even like this with an ;# extension from another topic ;-) git grep -e pattern master..next ;# or even from rev ranges git grep -e pattern master~20:Documentation ;# or an arbitrary tree git grep -e pattern next:git-commit.sh ;# or an arbitrary blob Right now, it does not understand and/or obey many options grep should accept, and the pattern must be given with -e option due to the way the parameter parser is structured, both of which obviously need to be fixed for usability. But this is going in the right direction. The shell script version is one of the worst Portability offender in the git barebone Porcelainish; it uses xargs -0 to pass paths around and shell arrays to sift flags and parameters. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'builtin.h')
-rw-r--r--builtin.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin.h b/builtin.h
index 47408a058..cf5de3b93 100644
--- a/builtin.h
+++ b/builtin.h
@@ -19,5 +19,6 @@ extern int cmd_version(int argc, const char **argv, char **envp);
extern int cmd_whatchanged(int argc, const char **argv, char **envp);
extern int cmd_show(int argc, const char **argv, char **envp);
extern int cmd_log(int argc, const char **argv, char **envp);
+extern int cmd_grep(int argc, const char **argv, char **envp);
#endif