Builtin git-cat-file
PATCH 1/1 Builtin git-cat-file
Signed-off-by Timo Hirvonen <[email protected]>
---
Not huge disc space savings but avoids fork+exec.
95174d93a8fb39b907f4f7359a381b9ad5757e5d
Makefile | 6 +++--- cat-file.c => builtin-cat-file.c | 3 ++- builtin.h | 1 + git.c | 1 + 4 files changed, 7 insertions(+), 4 deletions(-) rename cat-file.c => builtin-cat-file.c (98%)
95174d93a8fb39b907f4f7359a381b9ad5757e5d
Makefile +3 -3
@@ -149,7 +149,7 @@ SIMPLE_PROGRAMS = \ # ... and all the rest that could be moved out of bindir to gitexecdir PROGRAMS = \ - git-apply$X git-cat-file$X \ + git-apply$X \ git-checkout-index$X git-clone-pack$X git-commit-tree$X \ git-convert-objects$X git-diff-files$X \ git-diff-index$X git-diff-stages$X \
@@ -171,7 +171,7 @@ PROGRAMS = \ BUILT_INS = git-log$X git-whatchanged$X git-show$X \ git-count-objects$X git-diff$X git-push$X \ git-grep$X git-rev-list$X git-check-ref-format$X \ - git-init-db$X + git-init-db$X git-cat-file$X # what 'all' will build and 'install' will install, in gitexecdir ALL_PROGRAMS = $(PROGRAMS) $(SIMPLE_PROGRAMS) $(SCRIPTS)
@@ -220,7 +220,7 @@ LIB_OBJS = \ BUILTIN_OBJS = \ builtin-log.o builtin-help.o builtin-count.o builtin-diff.o builtin-push.o \ builtin-grep.o builtin-rev-list.o builtin-check-ref-format.o \ - builtin-init-db.o + builtin-init-db.o builtin-cat-file.o GITLIBS = $(LIB_FILE) $(XDIFF_LIB) LIBS = $(GITLIBS) -lz
builtin-cat-file.c renamed from cat-file.c +2 -1
@@ -7,6 +7,7 @@ #include "cache.h"#include "exec_cmd.h" #include "tag.h" #include "tree.h" +#include "builtin.h" static void flush_buffer (const char *buf,unsigned long size) {
@@ -93,7 +94,7 @@ static int pprint_tag(const unsigned chareturn 0 ; } -int main (int argc,char **argv) +int cmd_cat_file (int argc,const char **argv,char **envp) {unsigned char sha1[20 ];char type[20 ];
builtin.h +1 -0
@@ -27,5 +27,6 @@ extern int cmd_grep(int argc, const charextern int cmd_rev_list (int argc,const char **argv,char **envp);extern int cmd_check_ref_format (int argc,const char **argv,char **envp);extern int cmd_init_db (int argc,const char **argv,char **envp); +extern int cmd_cat_file (int argc,const char **argv,char **envp);#endif
git.c +1 -0
@@ -52,6 +52,7 @@ static void handle_internal_command(int { "grep", cmd_grep }, { "rev-list", cmd_rev_list }, { "init-db", cmd_init_db }, + { "cat-file", cmd_cat_file }, { "check-ref-format", cmd_check_ref_format } };int i;
Signature · 1 line
1.3.3.g40505-dirty