* [PATCH] Make git-name-rev a builtin
@ 2006-08-03 15:24 Matthias Kestenholz
2006-08-03 15:24 ` [PATCH] Make git-pack-objects " Matthias Kestenholz
0 siblings, 1 reply; 5+ messages in thread
From: Matthias Kestenholz @ 2006-08-03 15:24 UTC (permalink / raw)
To: junkio; +Cc: git, Matthias Kestenholz
Signed-off-by: Matthias Kestenholz <matthias@spinlock.ch>
---
Makefile | 7 ++++---
name-rev.c => builtin-name-rev.c | 4 ++--
builtin.h | 1 +
git.c | 1 +
4 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/Makefile b/Makefile
index 1c1427e..67b6846 100644
--- a/Makefile
+++ b/Makefile
@@ -204,7 +204,7 @@ PROGRAMS = \
git-unpack-objects$X git-update-server-info$X \
git-upload-pack$X git-verify-pack$X \
git-symbolic-ref$X \
- git-name-rev$X git-pack-redundant$X git-var$X \
+ git-pack-redundant$X git-var$X \
git-describe$X git-merge-tree$X git-blame$X git-imap-send$X \
git-merge-recur$X
@@ -218,7 +218,7 @@ BUILT_INS = git-log$X git-whatchanged$X
git-apply$X git-show-branch$X git-diff-files$X git-update-index$X \
git-diff-index$X git-diff-stages$X git-diff-tree$X git-cat-file$X \
git-fmt-merge-msg$X git-prune$X git-mv$X git-prune-packed$X \
- git-repo-config$X
+ git-repo-config$X git-name-rev$X
# what 'all' will build and 'install' will install, in gitexecdir
ALL_PROGRAMS = $(PROGRAMS) $(SIMPLE_PROGRAMS) $(SCRIPTS)
@@ -275,7 +275,8 @@ BUILTIN_OBJS = \
builtin-diff-index.o builtin-diff-stages.o builtin-diff-tree.o \
builtin-cat-file.o builtin-mailsplit.o builtin-stripspace.o \
builtin-update-ref.o builtin-fmt-merge-msg.o builtin-prune.o \
- builtin-mv.o builtin-prune-packed.o builtin-repo-config.o
+ builtin-mv.o builtin-prune-packed.o builtin-repo-config.o \
+ builtin-name-rev.o
GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
EXTLIBS = -lz
diff --git a/name-rev.c b/builtin-name-rev.c
similarity index 98%
rename from name-rev.c
rename to builtin-name-rev.c
index f92f14e..571bba4 100644
--- a/name-rev.c
+++ b/builtin-name-rev.c
@@ -1,4 +1,5 @@
#include <stdlib.h>
+#include "builtin.h"
#include "cache.h"
#include "commit.h"
#include "tag.h"
@@ -126,12 +127,11 @@ static const char* get_rev_name(struct o
return buffer;
}
-int main(int argc, char **argv)
+int cmd_name_rev(int argc, const char **argv, const char *prefix)
{
struct object_array revs = { 0, 0, NULL };
int as_is = 0, all = 0, transform_stdin = 0;
- setup_git_directory();
git_config(git_default_config);
if (argc < 2)
diff --git a/builtin.h b/builtin.h
index 26ebcaf..d1d9dc1 100644
--- a/builtin.h
+++ b/builtin.h
@@ -49,6 +49,7 @@ extern int cmd_update_ref(int argc, cons
extern int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix);
extern int cmd_mv(int argc, const char **argv, const char *prefix);
extern int cmd_repo_config(int argc, const char **argv, const char *prefix);
+extern int cmd_name_rev(int argc, const char **argv, const char *prefix);
extern int cmd_write_tree(int argc, const char **argv, const char *prefix);
extern int write_tree(unsigned char *sha1, int missing_ok, const char *prefix);
diff --git a/git.c b/git.c
index 6e72a89..501a781 100644
--- a/git.c
+++ b/git.c
@@ -265,6 +265,7 @@ static void handle_internal_command(int
{ "mv", cmd_mv, NEEDS_PREFIX },
{ "prune-packed", cmd_prune_packed, NEEDS_PREFIX },
{ "repo-config", cmd_repo_config },
+ { "name-rev", cmd_name_rev, NEEDS_PREFIX },
};
int i;
--
1.4.2.rc2.g2e994
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] Make git-pack-objects a builtin
2006-08-03 15:24 [PATCH] Make git-name-rev a builtin Matthias Kestenholz
@ 2006-08-03 15:24 ` Matthias Kestenholz
2006-08-03 15:24 ` [PATCH] Make git-unpack-objects " Matthias Kestenholz
0 siblings, 1 reply; 5+ messages in thread
From: Matthias Kestenholz @ 2006-08-03 15:24 UTC (permalink / raw)
To: junkio; +Cc: git, Matthias Kestenholz
Signed-off-by: Matthias Kestenholz <matthias@spinlock.ch>
---
Makefile | 6 +++---
pack-objects.c => builtin-pack-objects.c | 4 ++--
builtin.h | 1 +
git.c | 1 +
4 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/Makefile b/Makefile
index 67b6846..4827bff 100644
--- a/Makefile
+++ b/Makefile
@@ -196,7 +196,7 @@ PROGRAMS = \
git-convert-objects$X git-fetch-pack$X git-fsck-objects$X \
git-hash-object$X git-index-pack$X git-local-fetch$X \
git-merge-base$X \
- git-merge-index$X git-mktag$X git-mktree$X git-pack-objects$X git-patch-id$X \
+ git-merge-index$X git-mktag$X git-mktree$X git-patch-id$X \
git-peek-remote$X git-receive-pack$X \
git-send-pack$X git-shell$X \
git-show-index$X git-ssh-fetch$X \
@@ -218,7 +218,7 @@ BUILT_INS = git-log$X git-whatchanged$X
git-apply$X git-show-branch$X git-diff-files$X git-update-index$X \
git-diff-index$X git-diff-stages$X git-diff-tree$X git-cat-file$X \
git-fmt-merge-msg$X git-prune$X git-mv$X git-prune-packed$X \
- git-repo-config$X git-name-rev$X
+ git-repo-config$X git-name-rev$X git-pack-objects$X
# what 'all' will build and 'install' will install, in gitexecdir
ALL_PROGRAMS = $(PROGRAMS) $(SIMPLE_PROGRAMS) $(SCRIPTS)
@@ -276,7 +276,7 @@ BUILTIN_OBJS = \
builtin-cat-file.o builtin-mailsplit.o builtin-stripspace.o \
builtin-update-ref.o builtin-fmt-merge-msg.o builtin-prune.o \
builtin-mv.o builtin-prune-packed.o builtin-repo-config.o \
- builtin-name-rev.o
+ builtin-name-rev.o builtin-pack-objects.o
GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
EXTLIBS = -lz
diff --git a/pack-objects.c b/builtin-pack-objects.c
similarity index 100%
rename from pack-objects.c
rename to builtin-pack-objects.c
index e52e977..2f99212 100644
--- a/pack-objects.c
+++ b/builtin-pack-objects.c
@@ -1,3 +1,4 @@
+#include "builtin.h"
#include "cache.h"
#include "object.h"
#include "blob.h"
@@ -1242,7 +1243,7 @@ static int git_pack_config(const char *k
return git_default_config(k, v);
}
-int main(int argc, char **argv)
+int cmd_pack_objects(int argc, const char **argv, const char *prefix)
{
SHA_CTX ctx;
char line[40 + 1 + PATH_MAX + 2];
@@ -1251,7 +1252,6 @@ int main(int argc, char **argv)
int num_preferred_base = 0;
int i;
- setup_git_directory();
git_config(git_pack_config);
progress = isatty(2);
diff --git a/builtin.h b/builtin.h
index d1d9dc1..bc57a04 100644
--- a/builtin.h
+++ b/builtin.h
@@ -50,6 +50,7 @@ extern int cmd_fmt_merge_msg(int argc, c
extern int cmd_mv(int argc, const char **argv, const char *prefix);
extern int cmd_repo_config(int argc, const char **argv, const char *prefix);
extern int cmd_name_rev(int argc, const char **argv, const char *prefix);
+extern int cmd_pack_objects(int argc, const char **argv, const char *prefix);
extern int cmd_write_tree(int argc, const char **argv, const char *prefix);
extern int write_tree(unsigned char *sha1, int missing_ok, const char *prefix);
diff --git a/git.c b/git.c
index 501a781..5d58946 100644
--- a/git.c
+++ b/git.c
@@ -266,6 +266,7 @@ static void handle_internal_command(int
{ "prune-packed", cmd_prune_packed, NEEDS_PREFIX },
{ "repo-config", cmd_repo_config },
{ "name-rev", cmd_name_rev, NEEDS_PREFIX },
+ { "pack-objects", cmd_pack_objects, NEEDS_PREFIX },
};
int i;
--
1.4.2.rc2.g2e994
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] Make git-unpack-objects a builtin
2006-08-03 15:24 ` [PATCH] Make git-pack-objects " Matthias Kestenholz
@ 2006-08-03 15:24 ` Matthias Kestenholz
2006-08-03 15:24 ` [PATCH] Make git-symbolic-ref " Matthias Kestenholz
0 siblings, 1 reply; 5+ messages in thread
From: Matthias Kestenholz @ 2006-08-03 15:24 UTC (permalink / raw)
To: junkio; +Cc: git, Matthias Kestenholz
Signed-off-by: Matthias Kestenholz <matthias@spinlock.ch>
---
Makefile | 7 ++++---
unpack-objects.c => builtin-unpack-objects.c | 4 ++--
builtin.h | 1 +
git.c | 1 +
4 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/Makefile b/Makefile
index 4827bff..4d0243b 100644
--- a/Makefile
+++ b/Makefile
@@ -201,7 +201,7 @@ PROGRAMS = \
git-send-pack$X git-shell$X \
git-show-index$X git-ssh-fetch$X \
git-ssh-upload$X git-unpack-file$X \
- git-unpack-objects$X git-update-server-info$X \
+ git-update-server-info$X \
git-upload-pack$X git-verify-pack$X \
git-symbolic-ref$X \
git-pack-redundant$X git-var$X \
@@ -218,7 +218,8 @@ BUILT_INS = git-log$X git-whatchanged$X
git-apply$X git-show-branch$X git-diff-files$X git-update-index$X \
git-diff-index$X git-diff-stages$X git-diff-tree$X git-cat-file$X \
git-fmt-merge-msg$X git-prune$X git-mv$X git-prune-packed$X \
- git-repo-config$X git-name-rev$X git-pack-objects$X
+ git-repo-config$X git-name-rev$X git-pack-objects$X \
+ git-unpack-objects$X
# what 'all' will build and 'install' will install, in gitexecdir
ALL_PROGRAMS = $(PROGRAMS) $(SIMPLE_PROGRAMS) $(SCRIPTS)
@@ -276,7 +277,7 @@ BUILTIN_OBJS = \
builtin-cat-file.o builtin-mailsplit.o builtin-stripspace.o \
builtin-update-ref.o builtin-fmt-merge-msg.o builtin-prune.o \
builtin-mv.o builtin-prune-packed.o builtin-repo-config.o \
- builtin-name-rev.o builtin-pack-objects.o
+ builtin-name-rev.o builtin-pack-objects.o builtin-unpack-objects.o
GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
EXTLIBS = -lz
diff --git a/unpack-objects.c b/builtin-unpack-objects.c
similarity index 99%
rename from unpack-objects.c
rename to builtin-unpack-objects.c
index b23fe58..ccf2643 100644
--- a/unpack-objects.c
+++ b/builtin-unpack-objects.c
@@ -1,3 +1,4 @@
+#include "builtin.h"
#include "cache.h"
#include "object.h"
#include "delta.h"
@@ -260,12 +261,11 @@ static void unpack_all(void)
die("unresolved deltas left after unpacking");
}
-int main(int argc, char **argv)
+int cmd_unpack_objects(int argc, const char **argv, const char *prefix)
{
int i;
unsigned char sha1[20];
- setup_git_directory();
git_config(git_default_config);
quiet = !isatty(2);
diff --git a/builtin.h b/builtin.h
index bc57a04..af73c3c 100644
--- a/builtin.h
+++ b/builtin.h
@@ -51,6 +51,7 @@ extern int cmd_mv(int argc, const char *
extern int cmd_repo_config(int argc, const char **argv, const char *prefix);
extern int cmd_name_rev(int argc, const char **argv, const char *prefix);
extern int cmd_pack_objects(int argc, const char **argv, const char *prefix);
+extern int cmd_unpack_objects(int argc, const char **argv, const char *prefix);
extern int cmd_write_tree(int argc, const char **argv, const char *prefix);
extern int write_tree(unsigned char *sha1, int missing_ok, const char *prefix);
diff --git a/git.c b/git.c
index 5d58946..7c3a7f8 100644
--- a/git.c
+++ b/git.c
@@ -267,6 +267,7 @@ static void handle_internal_command(int
{ "repo-config", cmd_repo_config },
{ "name-rev", cmd_name_rev, NEEDS_PREFIX },
{ "pack-objects", cmd_pack_objects, NEEDS_PREFIX },
+ { "unpack-objects", cmd_unpack_objects, NEEDS_PREFIX },
};
int i;
--
1.4.2.rc2.g2e994
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] Make git-symbolic-ref a builtin
2006-08-03 15:24 ` [PATCH] Make git-unpack-objects " Matthias Kestenholz
@ 2006-08-03 15:24 ` Matthias Kestenholz
2006-08-03 15:24 ` [PATCH] Make git-local-fetch " Matthias Kestenholz
0 siblings, 1 reply; 5+ messages in thread
From: Matthias Kestenholz @ 2006-08-03 15:24 UTC (permalink / raw)
To: junkio; +Cc: git, Matthias Kestenholz
Signed-off-by: Matthias Kestenholz <matthias@spinlock.ch>
---
Makefile | 6 +++---
symbolic-ref.c => builtin-symbolic-ref.c | 4 ++--
builtin.h | 1 +
git.c | 1 +
4 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/Makefile b/Makefile
index 4d0243b..785e188 100644
--- a/Makefile
+++ b/Makefile
@@ -203,7 +203,6 @@ PROGRAMS = \
git-ssh-upload$X git-unpack-file$X \
git-update-server-info$X \
git-upload-pack$X git-verify-pack$X \
- git-symbolic-ref$X \
git-pack-redundant$X git-var$X \
git-describe$X git-merge-tree$X git-blame$X git-imap-send$X \
git-merge-recur$X
@@ -219,7 +218,7 @@ BUILT_INS = git-log$X git-whatchanged$X
git-diff-index$X git-diff-stages$X git-diff-tree$X git-cat-file$X \
git-fmt-merge-msg$X git-prune$X git-mv$X git-prune-packed$X \
git-repo-config$X git-name-rev$X git-pack-objects$X \
- git-unpack-objects$X
+ git-unpack-objects$X git-symbolic-ref$X
# what 'all' will build and 'install' will install, in gitexecdir
ALL_PROGRAMS = $(PROGRAMS) $(SIMPLE_PROGRAMS) $(SCRIPTS)
@@ -277,7 +276,8 @@ BUILTIN_OBJS = \
builtin-cat-file.o builtin-mailsplit.o builtin-stripspace.o \
builtin-update-ref.o builtin-fmt-merge-msg.o builtin-prune.o \
builtin-mv.o builtin-prune-packed.o builtin-repo-config.o \
- builtin-name-rev.o builtin-pack-objects.o builtin-unpack-objects.o
+ builtin-name-rev.o builtin-pack-objects.o builtin-unpack-objects.o \
+ builtin-symbolic-ref.o
GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
EXTLIBS = -lz
diff --git a/symbolic-ref.c b/builtin-symbolic-ref.c
similarity index 89%
rename from symbolic-ref.c
rename to builtin-symbolic-ref.c
index 193c87c..b4ec6f2 100644
--- a/symbolic-ref.c
+++ b/builtin-symbolic-ref.c
@@ -1,3 +1,4 @@
+#include "builtin.h"
#include "cache.h"
static const char git_symbolic_ref_usage[] =
@@ -17,9 +18,8 @@ static void check_symref(const char *HEA
die("No such ref: %s", HEAD);
}
-int main(int argc, const char **argv)
+int cmd_symbolic_ref(int argc, const char **argv, const char *prefix)
{
- setup_git_directory();
git_config(git_default_config);
switch (argc) {
case 2:
diff --git a/builtin.h b/builtin.h
index af73c3c..b767245 100644
--- a/builtin.h
+++ b/builtin.h
@@ -52,6 +52,7 @@ extern int cmd_repo_config(int argc, con
extern int cmd_name_rev(int argc, const char **argv, const char *prefix);
extern int cmd_pack_objects(int argc, const char **argv, const char *prefix);
extern int cmd_unpack_objects(int argc, const char **argv, const char *prefix);
+extern int cmd_symbolic_ref(int argc, const char **argv, const char *prefix);
extern int cmd_write_tree(int argc, const char **argv, const char *prefix);
extern int write_tree(unsigned char *sha1, int missing_ok, const char *prefix);
diff --git a/git.c b/git.c
index 7c3a7f8..e40e859 100644
--- a/git.c
+++ b/git.c
@@ -268,6 +268,7 @@ static void handle_internal_command(int
{ "name-rev", cmd_name_rev, NEEDS_PREFIX },
{ "pack-objects", cmd_pack_objects, NEEDS_PREFIX },
{ "unpack-objects", cmd_unpack_objects, NEEDS_PREFIX },
+ { "symbolic-ref", cmd_symbolic_ref, NEEDS_PREFIX },
};
int i;
--
1.4.2.rc2.g2e994
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] Make git-local-fetch a builtin
2006-08-03 15:24 ` [PATCH] Make git-symbolic-ref " Matthias Kestenholz
@ 2006-08-03 15:24 ` Matthias Kestenholz
0 siblings, 0 replies; 5+ messages in thread
From: Matthias Kestenholz @ 2006-08-03 15:24 UTC (permalink / raw)
To: junkio; +Cc: git, Matthias Kestenholz
Signed-off-by: Matthias Kestenholz <matthias@spinlock.ch>
---
Please note! I added fetch.o to the list of LIB_OBJS. I don't know if
it should be done like that. builtin-local-fetch.o depends on fetch.o
and LIB_OBJS seemed to be the best place to add fetch.o.
Makefile | 9 +++++----
local-fetch.c => builtin-local-fetch.c | 3 ++-
builtin.h | 1 +
git.c | 1 +
4 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/Makefile b/Makefile
index 785e188..c1285f5 100644
--- a/Makefile
+++ b/Makefile
@@ -194,7 +194,7 @@ # ... and all the rest that could be mov
PROGRAMS = \
git-checkout-index$X \
git-convert-objects$X git-fetch-pack$X git-fsck-objects$X \
- git-hash-object$X git-index-pack$X git-local-fetch$X \
+ git-hash-object$X git-index-pack$X \
git-merge-base$X \
git-merge-index$X git-mktag$X git-mktree$X git-patch-id$X \
git-peek-remote$X git-receive-pack$X \
@@ -218,7 +218,7 @@ BUILT_INS = git-log$X git-whatchanged$X
git-diff-index$X git-diff-stages$X git-diff-tree$X git-cat-file$X \
git-fmt-merge-msg$X git-prune$X git-mv$X git-prune-packed$X \
git-repo-config$X git-name-rev$X git-pack-objects$X \
- git-unpack-objects$X git-symbolic-ref$X
+ git-unpack-objects$X git-symbolic-ref$X git-local-fetch$X
# what 'all' will build and 'install' will install, in gitexecdir
ALL_PROGRAMS = $(PROGRAMS) $(SIMPLE_PROGRAMS) $(SCRIPTS)
@@ -262,7 +262,8 @@ LIB_OBJS = \
server-info.o setup.o sha1_file.o sha1_name.o strbuf.o \
tag.o tree.o usage.o config.o environment.o ctype.o copy.o \
fetch-clone.o revision.o pager.o tree-walk.o xdiff-interface.o \
- alloc.o merge-file.o path-list.o unpack-trees.o $(DIFF_OBJS)
+ alloc.o merge-file.o path-list.o unpack-trees.o fetch.o \
+ $(DIFF_OBJS)
BUILTIN_OBJS = \
builtin-log.o builtin-help.o builtin-count.o builtin-diff.o builtin-push.o \
@@ -277,7 +278,7 @@ BUILTIN_OBJS = \
builtin-update-ref.o builtin-fmt-merge-msg.o builtin-prune.o \
builtin-mv.o builtin-prune-packed.o builtin-repo-config.o \
builtin-name-rev.o builtin-pack-objects.o builtin-unpack-objects.o \
- builtin-symbolic-ref.o
+ builtin-symbolic-ref.o builtin-local-fetch.o
GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
EXTLIBS = -lz
diff --git a/local-fetch.c b/builtin-local-fetch.c
similarity index 99%
rename from local-fetch.c
rename to builtin-local-fetch.c
index b216bdd..2a082d8 100644
--- a/local-fetch.c
+++ b/builtin-local-fetch.c
@@ -1,6 +1,7 @@
/*
* Copyright (C) 2005 Junio C Hamano
*/
+#include "builtin.h"
#include "cache.h"
#include "commit.h"
#include "fetch.h"
@@ -203,7 +204,7 @@ static const char local_pull_usage[] =
* If -s is specified, then a symlink is attempted.
* If -n is _not_ specified, then a regular file-to-file copy is done.
*/
-int main(int argc, const char **argv)
+int cmd_local_fetch(int argc, const char **argv, const char *prefix)
{
int commits;
const char **write_ref = NULL;
diff --git a/builtin.h b/builtin.h
index b767245..3da353f 100644
--- a/builtin.h
+++ b/builtin.h
@@ -53,6 +53,7 @@ extern int cmd_name_rev(int argc, const
extern int cmd_pack_objects(int argc, const char **argv, const char *prefix);
extern int cmd_unpack_objects(int argc, const char **argv, const char *prefix);
extern int cmd_symbolic_ref(int argc, const char **argv, const char *prefix);
+extern int cmd_local_fetch(int argc, const char **argv, const char *prefix);
extern int cmd_write_tree(int argc, const char **argv, const char *prefix);
extern int write_tree(unsigned char *sha1, int missing_ok, const char *prefix);
diff --git a/git.c b/git.c
index e40e859..a4ce155 100644
--- a/git.c
+++ b/git.c
@@ -269,6 +269,7 @@ static void handle_internal_command(int
{ "pack-objects", cmd_pack_objects, NEEDS_PREFIX },
{ "unpack-objects", cmd_unpack_objects, NEEDS_PREFIX },
{ "symbolic-ref", cmd_symbolic_ref, NEEDS_PREFIX },
+ { "local-fetch", cmd_local_fetch, NEEDS_PREFIX },
};
int i;
--
1.4.2.rc2.g2e994
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2006-08-03 15:25 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-03 15:24 [PATCH] Make git-name-rev a builtin Matthias Kestenholz
2006-08-03 15:24 ` [PATCH] Make git-pack-objects " Matthias Kestenholz
2006-08-03 15:24 ` [PATCH] Make git-unpack-objects " Matthias Kestenholz
2006-08-03 15:24 ` [PATCH] Make git-symbolic-ref " Matthias Kestenholz
2006-08-03 15:24 ` [PATCH] Make git-local-fetch " Matthias Kestenholz
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).