Make git-name-rev a builtin
PATCH 1/1 Make git-name-rev a builtin
Signed-off-by Matthias Kestenholz <[email protected]>
--- Makefile | 7 ++++--- name-rev.c => builtin-name-rev.c | 4 ++-- builtin.h | 1 + git.c | 1 + 4 files changed, 8 insertions(+), 5 deletions(-)
Makefile +4 -3
@@ -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
builtin-name-rev.c renamed from name-rev.c +2 -2
@@ -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 oreturn 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 )
builtin.h +1 -0
@@ -49,6 +49,7 @@ extern int cmd_update_ref(int argc, consextern 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);
git.c +1 -0
@@ -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;
Signature · 1 line
1.4.2.rc2.g2e994
PATCH 1/1 Make git-pack-objects a builtin
Signed-off-by Matthias Kestenholz <[email protected]>
--- Makefile | 6 +++--- pack-objects.c => builtin-pack-objects.c | 4 ++-- builtin.h | 1 + git.c | 1 + 4 files changed, 7 insertions(+), 5 deletions(-)
Makefile +3 -3
@@ -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
builtin-pack-objects.c renamed from pack-objects.c +2 -2
@@ -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 *kreturn 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 );
builtin.h +1 -0
@@ -50,6 +50,7 @@ extern int cmd_fmt_merge_msg(int argc, cextern 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);
git.c +1 -0
@@ -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;
Signature · 1 line
1.4.2.rc2.g2e994
PATCH 1/1 Make git-unpack-objects a builtin
Signed-off-by Matthias Kestenholz <[email protected]>
--- Makefile | 7 ++++--- unpack-objects.c => builtin-unpack-objects.c | 4 ++-- builtin.h | 1 + git.c | 1 + 4 files changed, 8 insertions(+), 5 deletions(-)
Makefile +4 -3
@@ -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
builtin-unpack-objects.c renamed from unpack-objects.c +2 -2
@@ -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 );
builtin.h +1 -0
@@ -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);
git.c +1 -0
@@ -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;
Signature · 1 line
1.4.2.rc2.g2e994
PATCH 1/1 Make git-symbolic-ref a builtin
Signed-off-by Matthias Kestenholz <[email protected]>
--- Makefile | 6 +++--- symbolic-ref.c => builtin-symbolic-ref.c | 4 ++-- builtin.h | 1 + git.c | 1 + 4 files changed, 7 insertions(+), 5 deletions(-)
Makefile +3 -3
@@ -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
builtin-symbolic-ref.c renamed from symbolic-ref.c +2 -2
@@ -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 *HEAdie ("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 :
builtin.h +1 -0
@@ -52,6 +52,7 @@ extern int cmd_repo_config(int argc, conextern 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);
git.c +1 -0
@@ -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;
Signature · 1 line
1.4.2.rc2.g2e994
PATCH 1/1 Make git-local-fetch a builtin
Signed-off-by Matthias Kestenholz <[email protected]>
---
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(-)
Makefile +5 -4
@@ -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
builtin-local-fetch.c renamed from local-fetch.c +2 -1
@@ -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 ;
builtin.h +1 -0
@@ -53,6 +53,7 @@ extern int cmd_name_rev(int argc, constextern 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);
git.c +1 -0
@@ -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;
Signature · 1 line
1.4.2.rc2.g2e994