mirror of
https://github.com/git/git.git
synced 2024-11-24 02:17:02 +08:00
make git-fast-import a builtin
There's no reason that git-fast-import benefits from being a separate binary. And as it links against libgit.a, it has a non-trivial disk footprint. Let's make it a builtin, which reduces the size of a stripped installation from 22MB to 21MB. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
d7a5649c82
commit
a006f875e2
3
Makefile
3
Makefile
@ -672,7 +672,6 @@ EXTRA_PROGRAMS =
|
||||
PROGRAMS += $(EXTRA_PROGRAMS)
|
||||
|
||||
PROGRAM_OBJS += daemon.o
|
||||
PROGRAM_OBJS += fast-import.o
|
||||
PROGRAM_OBJS += http-backend.o
|
||||
PROGRAM_OBJS += imap-send.o
|
||||
PROGRAM_OBJS += remote-testsvn.o
|
||||
@ -1069,6 +1068,7 @@ BUILTIN_OBJS += builtin/diff.o
|
||||
BUILTIN_OBJS += builtin/difftool.o
|
||||
BUILTIN_OBJS += builtin/env--helper.o
|
||||
BUILTIN_OBJS += builtin/fast-export.o
|
||||
BUILTIN_OBJS += builtin/fast-import.o
|
||||
BUILTIN_OBJS += builtin/fetch-pack.o
|
||||
BUILTIN_OBJS += builtin/fetch.o
|
||||
BUILTIN_OBJS += builtin/fmt-merge-msg.o
|
||||
@ -2897,7 +2897,6 @@ ifdef MSVC
|
||||
$(INSTALL) git.pdb '$(DESTDIR_SQ)$(bindir_SQ)'
|
||||
$(INSTALL) git-shell.pdb '$(DESTDIR_SQ)$(bindir_SQ)'
|
||||
$(INSTALL) git-daemon.pdb '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
|
||||
$(INSTALL) git-fast-import.pdb '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
|
||||
$(INSTALL) git-http-backend.pdb '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
|
||||
$(INSTALL) git-http-fetch.pdb '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
|
||||
$(INSTALL) git-http-push.pdb '$(DESTDIR_SQ)$(gitexec_instdir_SQ)'
|
||||
|
@ -150,6 +150,7 @@ int cmd_diff_tree(int argc, const char **argv, const char *prefix);
|
||||
int cmd_difftool(int argc, const char **argv, const char *prefix);
|
||||
int cmd_env__helper(int argc, const char **argv, const char *prefix);
|
||||
int cmd_fast_export(int argc, const char **argv, const char *prefix);
|
||||
int cmd_fast_import(int argc, const char **argv, const char *prefix);
|
||||
int cmd_fetch(int argc, const char **argv, const char *prefix);
|
||||
int cmd_fetch_pack(int argc, const char **argv, const char *prefix);
|
||||
int cmd_fmt_merge_msg(int argc, const char **argv, const char *prefix);
|
||||
|
@ -3519,14 +3519,13 @@ static void parse_argv(void)
|
||||
build_mark_map(&sub_marks_from, &sub_marks_to);
|
||||
}
|
||||
|
||||
int cmd_main(int argc, const char **argv)
|
||||
int cmd_fast_import(int argc, const char **argv, const char *prefix)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
if (argc == 2 && !strcmp(argv[1], "-h"))
|
||||
usage(fast_import_usage);
|
||||
|
||||
setup_git_directory();
|
||||
reset_pack_idx_option(&pack_idx_opts);
|
||||
git_pack_config();
|
||||
|
@ -501,7 +501,7 @@ unset(CMAKE_REQUIRED_INCLUDES)
|
||||
|
||||
#programs
|
||||
set(PROGRAMS_BUILT
|
||||
git git-daemon git-fast-import git-http-backend git-sh-i18n--envsubst
|
||||
git git-daemon git-http-backend git-sh-i18n--envsubst
|
||||
git-shell git-remote-testsvn)
|
||||
|
||||
if(NOT CURL_FOUND)
|
||||
@ -627,9 +627,6 @@ target_link_libraries(git common-main)
|
||||
add_executable(git-daemon ${CMAKE_SOURCE_DIR}/daemon.c)
|
||||
target_link_libraries(git-daemon common-main)
|
||||
|
||||
add_executable(git-fast-import ${CMAKE_SOURCE_DIR}/fast-import.c)
|
||||
target_link_libraries(git-fast-import common-main)
|
||||
|
||||
add_executable(git-http-backend ${CMAKE_SOURCE_DIR}/http-backend.c)
|
||||
target_link_libraries(git-http-backend common-main)
|
||||
|
||||
|
1
git.c
1
git.c
@ -511,6 +511,7 @@ static struct cmd_struct commands[] = {
|
||||
{ "difftool", cmd_difftool, RUN_SETUP_GENTLY },
|
||||
{ "env--helper", cmd_env__helper },
|
||||
{ "fast-export", cmd_fast_export, RUN_SETUP },
|
||||
{ "fast-import", cmd_fast_import, RUN_SETUP | NO_PARSEOPT },
|
||||
{ "fetch", cmd_fetch, RUN_SETUP },
|
||||
{ "fetch-pack", cmd_fetch_pack, RUN_SETUP | NO_PARSEOPT },
|
||||
{ "fmt-merge-msg", cmd_fmt_merge_msg, RUN_SETUP },
|
||||
|
Loading…
Reference in New Issue
Block a user