From 0d78153952e70c21e94dc6b7eefcb2ac5337a902 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Wed, 17 May 2006 09:33:32 -0700 Subject: Do "git add" as a builtin First try. Let's see how well this works. In many ways, the hard parts of "git commit" are not so different from this, and a builtin commit would share a lot of the code, I think. Signed-off-by: Linus Torvalds Signed-off-by: Junio C Hamano --- builtin.h | 1 + 1 file changed, 1 insertion(+) (limited to 'builtin.h') diff --git a/builtin.h b/builtin.h index 7744f7d2f6..1b77f4b0ca 100644 --- a/builtin.h +++ b/builtin.h @@ -24,5 +24,6 @@ extern int cmd_count_objects(int argc, const char **argv, char **envp); extern int cmd_push(int argc, const char **argv, char **envp); extern int cmd_grep(int argc, const char **argv, char **envp); +extern int cmd_add(int argc, const char **argv, char **envp); #endif -- cgit v1.2.3 From d9b814cc97f16daac06566a5340121c446136d22 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Fri, 19 May 2006 16:19:34 -0700 Subject: Add builtin "git rm" command This changes semantics very subtly, because it adds a new atomicity guarantee. In particular, if you "git rm" several files, it will now do all or nothing. The old shell-script really looped over the removed files one by one, and would basically randomly fail in the middle if "-f" was used and one of the files didn't exist in the working directory. This C builtin one will not re-write the index after each remove, but instead remove all files at once. However, that means that if "-f" is used (to also force removal of the file from the working directory), and some files have already been removed from the workspace, it won't stop in the middle in some half-way state like the old one did. So what happens is that if the _first_ file fails to be removed with "-f", we abort the whole "git rm". But once we've started removing, we don't leave anything half done. If some of the other files don't exist, we'll just ignore errors of removal from the working tree. This is only an issue with "-f", of course. I think the new behaviour is strictly an improvement, but perhaps more importantly, it is _different_. As a special case, the semantics are identical for the single-file case (which is the only one our test-suite seems to test). The other question is what to do with leading directories. The old "git rm" script didn't do anything, which is somewhat inconsistent. This one will actually clean up directories that have become empty as a result of removing the last file, but maybe we want to have a flag to decide the behaviour? Signed-off-by: Linus Torvalds Signed-off-by: Junio C Hamano --- builtin.h | 1 + 1 file changed, 1 insertion(+) (limited to 'builtin.h') diff --git a/builtin.h b/builtin.h index 1b77f4b0ca..c1cb765dea 100644 --- a/builtin.h +++ b/builtin.h @@ -24,6 +24,7 @@ extern int cmd_count_objects(int argc, const char **argv, char **envp); extern int cmd_push(int argc, const char **argv, char **envp); extern int cmd_grep(int argc, const char **argv, char **envp); +extern int cmd_rm(int argc, const char **argv, char **envp); extern int cmd_add(int argc, const char **argv, char **envp); #endif -- cgit v1.2.3 From 217542640ed219c980fff2b3c307c4520120f20f Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 18 May 2006 18:46:44 -0700 Subject: built-in tar-tree and remote tar-tree This makes tar-tree a built-in. As an added bonus, you can now say: git tar-tree --remote=remote-repository [] This does not work with git-daemon yet, but should work with localhost and git over ssh transports. Signed-off-by: Junio C Hamano --- builtin.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'builtin.h') diff --git a/builtin.h b/builtin.h index 60541262c4..f22783c499 100644 --- a/builtin.h +++ b/builtin.h @@ -27,5 +27,7 @@ extern int cmd_grep(int argc, const char **argv, char **envp); extern 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_tar_tree(int argc, const char **argv, char **envp); +extern int cmd_upload_tar(int argc, const char **argv, char **envp); #endif -- cgit v1.2.3 From 0864f26421b3c599b462bc867de948d14b268d76 Mon Sep 17 00:00:00 2001 From: Peter Eriksen Date: Tue, 23 May 2006 14:15:29 +0200 Subject: Builtin git-ls-files. Signed-off-by: Peter Eriksen Signed-off-by: Junio C Hamano --- builtin.h | 1 + 1 file changed, 1 insertion(+) (limited to 'builtin.h') diff --git a/builtin.h b/builtin.h index 60541262c4..a0713d3747 100644 --- a/builtin.h +++ b/builtin.h @@ -27,5 +27,6 @@ extern int cmd_grep(int argc, const char **argv, char **envp); extern 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_ls_files(int argc, const char **argv, char **envp); #endif -- cgit v1.2.3 From aae01bda7f6d3224cf6b2ce0aa9aa668ce35d0b7 Mon Sep 17 00:00:00 2001 From: Peter Eriksen Date: Tue, 23 May 2006 14:15:30 +0200 Subject: Builtin git-ls-tree. Signed-off-by: Peter Eriksen Signed-off-by: Junio C Hamano --- builtin.h | 1 + 1 file changed, 1 insertion(+) (limited to 'builtin.h') diff --git a/builtin.h b/builtin.h index a0713d3747..951f206372 100644 --- a/builtin.h +++ b/builtin.h @@ -28,5 +28,6 @@ extern 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_ls_files(int argc, const char **argv, char **envp); +extern int cmd_ls_tree(int argc, const char **argv, char **envp); #endif -- cgit v1.2.3 From 56d1398ad305498faf57d6e433f97ad393d7909e Mon Sep 17 00:00:00 2001 From: Peter Eriksen Date: Tue, 23 May 2006 14:15:31 +0200 Subject: Builtin git-tar-tree. Signed-off-by: Peter Eriksen Signed-off-by: Junio C Hamano --- builtin.h | 1 + 1 file changed, 1 insertion(+) (limited to 'builtin.h') diff --git a/builtin.h b/builtin.h index 951f206372..d210543948 100644 --- a/builtin.h +++ b/builtin.h @@ -29,5 +29,6 @@ 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_ls_files(int argc, const char **argv, char **envp); extern int cmd_ls_tree(int argc, const char **argv, char **envp); +extern int cmd_tar_tree(int argc, const char **argv, char **envp); #endif -- cgit v1.2.3 From d147e501f37a596e73a430ce46f125f83e06aa07 Mon Sep 17 00:00:00 2001 From: Peter Eriksen Date: Tue, 23 May 2006 14:15:32 +0200 Subject: Builtin git-read-tree. Signed-off-by: Peter Eriksen Signed-off-by: Junio C Hamano --- builtin.h | 1 + 1 file changed, 1 insertion(+) (limited to 'builtin.h') diff --git a/builtin.h b/builtin.h index d210543948..88b3523c25 100644 --- a/builtin.h +++ b/builtin.h @@ -30,5 +30,6 @@ extern int cmd_init_db(int argc, const char **argv, char **envp); extern int cmd_ls_files(int argc, const char **argv, char **envp); 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); #endif -- cgit v1.2.3 From 6d96ac18e52aca19ff1087ffa64e2d616cc75c6f Mon Sep 17 00:00:00 2001 From: Peter Eriksen Date: Tue, 23 May 2006 14:15:33 +0200 Subject: Builtin git-commit-tree. Signed-off-by: Peter Eriksen Signed-off-by: Junio C Hamano --- builtin.h | 1 + 1 file changed, 1 insertion(+) (limited to 'builtin.h') diff --git a/builtin.h b/builtin.h index 88b3523c25..c6b07d9a65 100644 --- a/builtin.h +++ b/builtin.h @@ -31,5 +31,6 @@ extern int cmd_ls_files(int argc, const char **argv, char **envp); 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 -- cgit v1.2.3 From ac6245e31a359200b65bfdd910bba9a0fbe90c11 Mon Sep 17 00:00:00 2001 From: Peter Eriksen Date: Tue, 23 May 2006 14:15:34 +0200 Subject: Builtin git-apply. Signed-off-by: Peter Eriksen Signed-off-by: Junio C Hamano --- builtin.h | 1 + 1 file changed, 1 insertion(+) (limited to 'builtin.h') diff --git a/builtin.h b/builtin.h index c6b07d9a65..d6ff88ebc1 100644 --- a/builtin.h +++ b/builtin.h @@ -32,5 +32,6 @@ 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); +extern int cmd_apply(int argc, const char **argv, char **envp); #endif -- cgit v1.2.3 From 51ce34b9923d9b119ac53414584f80e05520abea Mon Sep 17 00:00:00 2001 From: Peter Eriksen Date: Tue, 23 May 2006 14:15:35 +0200 Subject: Builtin git-show-branch. Signed-off-by: Peter Eriksen Signed-off-by: Junio C Hamano --- builtin.h | 1 + 1 file changed, 1 insertion(+) (limited to 'builtin.h') diff --git a/builtin.h b/builtin.h index d6ff88ebc1..01882ec93d 100644 --- a/builtin.h +++ b/builtin.h @@ -33,5 +33,6 @@ 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); extern int cmd_apply(int argc, const char **argv, char **envp); +extern int cmd_show_branch(int argc, const char **argv, char **envp); #endif -- cgit v1.2.3 From e8cc9cd98e2ecd7fd8bb03e725d470405c8e2b94 Mon Sep 17 00:00:00 2001 From: Peter Eriksen Date: Tue, 23 May 2006 14:15:36 +0200 Subject: Builtin git-diff-files, git-diff-index, git-diff-stages, and git-diff-tree. Signed-off-by: Peter Eriksen Signed-off-by: Junio C Hamano --- builtin.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'builtin.h') diff --git a/builtin.h b/builtin.h index 01882ec93d..7620984624 100644 --- a/builtin.h +++ b/builtin.h @@ -34,5 +34,10 @@ extern int cmd_read_tree(int argc, const char **argv, char **envp); extern int cmd_commit_tree(int argc, const char **argv, char **envp); extern int cmd_apply(int argc, const char **argv, char **envp); extern int cmd_show_branch(int argc, const char **argv, char **envp); +extern int cmd_diff_files(int argc, const char **argv, char **envp); +extern int cmd_diff_index(int argc, const char **argv, char **envp); +extern int cmd_diff_stages(int argc, const char **argv, char **envp); +extern int cmd_diff_tree(int argc, const char **argv, char **envp); + #endif -- cgit v1.2.3 From f81daefe56b3c97b93a851e1ada14eeca0dea47a Mon Sep 17 00:00:00 2001 From: Timo Hirvonen Date: Wed, 24 May 2006 14:08:46 +0300 Subject: Builtin git-cat-file Signed-off-by: Timo Hirvonen Signed-off-by: Junio C Hamano --- builtin.h | 1 + 1 file changed, 1 insertion(+) (limited to 'builtin.h') diff --git a/builtin.h b/builtin.h index 714b97578c..738ec3d945 100644 --- a/builtin.h +++ b/builtin.h @@ -42,5 +42,6 @@ extern int cmd_diff_files(int argc, const char **argv, char **envp); extern int cmd_diff_index(int argc, const char **argv, char **envp); extern int cmd_diff_stages(int argc, const char **argv, char **envp); extern int cmd_diff_tree(int argc, const char **argv, char **envp); +extern int cmd_cat_file(int argc, const char **argv, char **envp); #endif -- cgit v1.2.3