From: Lukas Sandström Date: Tue, 13 Jun 2006 20:22:06 GMT Subject: [PATCH/RFC 8/8] Make git-am a builtin Message-ID: <448F1E6E.8000003@etek.chalmers.se> In-Reply-To: <448EF791.7070504@etek.chalmers.se> Signed-off-by: Lukas Sandström --- Being able to switch index-file on the fly would reduce the number of system() calls. A way to check if the index/working dir is dirty would also help. Makefile | 6 - builtin-am.c | 664 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ builtin.h | 1 git-am.sh | 427 ------------------------------------- git.c | 3 5 files changed, 670 insertions(+), 431 deletions(-) diff --git a/Makefile b/Makefile index 4b30ca0..e9b372e 100644 --- a/Makefile +++ b/Makefile @@ -122,7 +122,7 @@ SCRIPT_SH = \ git-repack.sh git-request-pull.sh git-reset.sh \ git-resolve.sh git-revert.sh git-sh-setup.sh \ git-tag.sh git-verify-tag.sh \ - git-applymbox.sh git-applypatch.sh git-am.sh \ + git-applymbox.sh git-applypatch.sh \ git-merge.sh git-merge-stupid.sh git-merge-octopus.sh \ git-merge-resolve.sh git-merge-ours.sh \ git-lost-found.sh git-quiltimport.sh @@ -166,7 +166,7 @@ PROGRAMS = \ BUILT_INS = git-log$X git-whatchanged$X git-show$X git-update-ref$X \ git-count-objects$X git-diff$X git-push$X git-mailsplit$X \ git-grep$X git-add$X git-rm$X git-rev-list$X git-stripspace$X \ - git-check-ref-format$X git-rev-parse$X git-mailinfo$X \ + git-check-ref-format$X git-rev-parse$X git-mailinfo$X git-am$X \ git-init-db$X git-tar-tree$X git-upload-tar$X git-format-patch$X \ git-ls-files$X git-ls-tree$X git-get-tar-commit-id$X \ git-read-tree$X git-commit-tree$X git-write-tree$X \ @@ -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-add.o builtin-rev-list.o builtin-check-ref-format.o \ - builtin-rm.o builtin-init-db.o builtin-rev-parse.o \ + builtin-rm.o builtin-init-db.o builtin-rev-parse.o builtin-am.o \ builtin-tar-tree.o builtin-upload-tar.o builtin-update-index.o \ builtin-ls-files.o builtin-ls-tree.o builtin-write-tree.o \ builtin-read-tree.o builtin-commit-tree.o builtin-mailinfo.o \ diff --git a/builtin-am.c b/builtin-am.c new file mode 100644 index 0000000..d9e7ac5 --- /dev/null +++ b/builtin-am.c @@ -0,0 +1,664 @@ +/* + * GIT - The information manager from hell + * + * Copyright (C) Lukas Sandström, 2006 + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "git-compat-util.h" +#include "cache.h" +#include "builtin.h" + +static char builtin_am_usage[] = "[--signoff] [--dotest=] [--utf8] [--binary] [--3way] " + "[--interactive] [--whitespace=