From: =?UTF-8?B?THVrYXMgU2FuZHN0csO2bQ==?= Subject: [PATCH/RFC 8/8] Make git-am a builtin Date: Tue, 13 Jun 2006 22:22:06 +0200 Organization: Chalmers Message-ID: <448F1E6E.8000003@etek.chalmers.se> References: <448EF791.7070504@etek.chalmers.se> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: =?UTF-8?B?THVrYXMgU2FuZHN0csO2bQ==?= X-From: git-owner@vger.kernel.org Tue Jun 13 22:22:27 2006 Return-path: Envelope-to: gcvg-git@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by ciao.gmane.org with esmtp (Exim 4.43) id 1FqFP3-0006Zx-9z for gcvg-git@gmane.org; Tue, 13 Jun 2006 22:22:22 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932222AbWFMUWO convert rfc822-to-quoted-printable (ORCPT ); Tue, 13 Jun 2006 16:22:14 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932224AbWFMUWO (ORCPT ); Tue, 13 Jun 2006 16:22:14 -0400 Received: from pne-smtpout1-sn2.hy.skanova.net ([81.228.8.83]:17342 "EHLO pne-smtpout1-sn2.hy.skanova.net") by vger.kernel.org with ESMTP id S932222AbWFMUWM (ORCPT ); Tue, 13 Jun 2006 16:22:12 -0400 Received: from [192.168.0.82] (213.66.93.165) by pne-smtpout1-sn2.hy.skanova.net (7.2.072.1) id 448977B3000E742F; Tue, 13 Jun 2006 22:22:07 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.8.0.4) Gecko/20060603 Thunderbird/1.5.0.4 Mnenhy/0.7.4.666 To: Junio C Hamano , Git Mailing List In-Reply-To: <448EF791.7070504@etek.chalmers.se> Sender: git-owner@vger.kernel.org Precedence: bulk X-Mailing-List: git@vger.kernel.org Archived-At: Signed-off-by: Lukas Sandstr=C3=B6m --- 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=20 git-am.sh | 427 ------------------------------------- git.c | 3=20 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 =3D \ 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 =3D \ BUILT_INS =3D 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 =3D \ BUILTIN_OBJS =3D \ builtin-log.o builtin-help.o builtin-count.o builtin-diff.o builtin-p= ush.o \ builtin-grep.o builtin-add.o builtin-rev-list.o builtin-check-ref-for= mat.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=C3=B6m, 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[] =3D "[--signoff] [--dotest=3D] [--= utf8] [--binary] [--3way] " + "[--interactive] [--whitespace=3D