git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 5/8] Builtin git-commit-tree.

From
PEPeter Eriksen <s022018@student.dtu.dk>
Date
May 23, 2006, 12:15 UTC
Message-ID
<14658.0410110348$1148386590@news.gmane.org>
In-Reply-To
<11483865361243-git-send-email-1>
From: Peter Eriksen <s022018@student.dtu.dk>
Signed-off-by: Peter Eriksen <s022018@student.dtu.dk>
---
762e5a2efcde796d84c573fe8bf3224c9fbf3588
 Makefile                               |    6 +++---
 commit-tree.c => builtin-commit-tree.c |    3 ++-
 builtin.h                              |    1 +
 git.c                                  |    3 ++-
 4 files changed, 8 insertions(+), 5 deletions(-)
 rename commit-tree.c => builtin-commit-tree.c (98%)
762e5a2efcde796d84c573fe8bf3224c9fbf3588
diff --git a/Makefile b/Makefile
index 667fa5d..a5efbc7 100644
--- a/Makefile
+++ b/Makefile
@@ -150,7 +150,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-checkout-index$X git-clone-pack$X git-commit-tree$X \
+	git-checkout-index$X git-clone-pack$X \
 	git-convert-objects$X git-diff-files$X \
 	git-diff-index$X git-diff-stages$X \
 	git-diff-tree$X git-fetch-pack$X git-fsck-objects$X \
@@ -172,7 +172,7 @@ BUILT_INS = git-log$X git-whatchanged$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-ls-files$X git-ls-tree$X \
-	git-tar-tree$X git-read-tree$X
+	git-tar-tree$X git-read-tree$X git-commit-tree$X
 
 # what 'all' will build and 'install' will install, in gitexecdir
 ALL_PROGRAMS = $(PROGRAMS) $(SIMPLE_PROGRAMS) $(SCRIPTS)
@@ -222,7 +222,7 @@ 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-ls-files.o builtin-ls-tree.o \
-        builtin-tar-tree.o builtin-read-tree.o
+        builtin-tar-tree.o builtin-read-tree.o builtin-commit-tree.o
 
 GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
 LIBS = $(GITLIBS) -lz
diff --git a/commit-tree.c b/builtin-commit-tree.c
similarity index 98%
rename from commit-tree.c
rename to builtin-commit-tree.c
index 0320036..4ccdbec 100644
--- a/commit-tree.c
+++ b/builtin-commit-tree.c
@@ -6,6 +6,7 @@
 #include "cache.h"
 #include "commit.h"
 #include "tree.h"
+#include "builtin.h"
 
 #define BLOCKING (1ul << 14)
 
@@ -76,7 +77,7 @@ static int new_parent(int idx)
 	return 1;
 }
 
-int main(int argc, char **argv)
+int cmd_commit_tree(int argc, const char **argv, char **envp)
 {
 	int i;
 	int parents = 0;
diff --git a/builtin.h b/builtin.h
index 88b3523..c6b07d9 100644
--- a/builtin.h
+++ b/builtin.h
@@ -31,5 +31,6 @@ extern int cmd_ls_files(int argc, const 
 extern int cmd_ls_tree(int argc, const char **argv, char **envp);
 extern int cmd_tar_tree(int argc, const char **argv, char **envp);
 extern int cmd_read_tree(int argc, const char **argv, char **envp);
+extern int cmd_commit_tree(int argc, const char **argv, char **envp);
 
 #endif
diff --git a/git.c b/git.c
index 300e2b2..4c2c062 100644
--- a/git.c
+++ b/git.c
@@ -56,7 +56,8 @@ static void handle_internal_command(int 
 		{ "ls-files", cmd_ls_files },
 		{ "ls-tree", cmd_ls_tree },
 		{ "tar-tree", cmd_tar_tree },
-		{ "read-tree", cmd_read_tree }
+		{ "read-tree", cmd_read_tree },
+		{ "commit-tree", cmd_commit_tree }
 	};
 	int i;
 
-- 
1.3.3.g288c
Previous: Peter EriksenNext: Peter Eriksen
Message 5 of 13 in “Builtin git-ls-files.”
  1. 1/8 Builtin git-ls-files.Peter Eriksen, May 23, 2006
  2. 2/8 Builtin git-ls-tree.Peter Eriksen, May 23, 2006
  3. 3/8 Builtin git-tar-tree.Peter Eriksen, May 23, 2006
  4. 4/8 Builtin git-read-tree.Peter Eriksen, May 23, 2006
  5. 5/8 Builtin git-commit-tree.Peter Eriksen, May 23, 2006
  6. 6/8 Builtin git-apply.Peter Eriksen, May 23, 2006
  7. 7/8 Builtin git-show-branch.Peter Eriksen, May 23, 2006
  8. 8/8 Builtin git-diff-files, git-diff-index, git-diff-stages, and git-diff-tree.Peter Eriksen, May 23, 2006
  9. Peter EriksenMay 23, 2006
  10. Jakub NarebskiMay 23, 2006
  11. Peter EriksenMay 23, 2006
  12. Jakub NarebskiMay 23, 2006
  13. Ryan AndersonMay 23, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.