3 @@ -559,16 +559,7 @@ EXTRA_PROGRAMS =
4 # ... and all the rest that could be moved out of bindir to gitexecdir
5 PROGRAMS += $(EXTRA_PROGRAMS)
7 -PROGRAM_OBJS += credential-store.o
8 -PROGRAM_OBJS += daemon.o
9 -PROGRAM_OBJS += fast-import.o
10 PROGRAM_OBJS += http-backend.o
11 -PROGRAM_OBJS += imap-send.o
12 -PROGRAM_OBJS += sh-i18n--envsubst.o
13 -PROGRAM_OBJS += shell.o
14 -PROGRAM_OBJS += show-index.o
15 -PROGRAM_OBJS += upload-pack.o
16 -PROGRAM_OBJS += remote-testsvn.o
18 # Binary suffix, set to .exe for Windows builds
20 @@ -929,6 +920,11 @@ BUILTIN_OBJS += builtin/verify-pack.o
21 BUILTIN_OBJS += builtin/verify-tag.o
22 BUILTIN_OBJS += builtin/worktree.o
23 BUILTIN_OBJS += builtin/write-tree.o
24 +BUILTIN_OBJS += builtin/daemon.o
25 +BUILTIN_OBJS += builtin/fast-import.o
26 +BUILTIN_OBJS += builtin/imap-send.o
27 +BUILTIN_OBJS += builtin/shell.o
28 +BUILTIN_OBJS += builtin/upload-pack.o
30 GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
32 @@ -1112,7 +1108,7 @@ endif
36 - OPENSSL_LIBSSL = -lssl
39 BASIC_CFLAGS += -I$(OPENSSLDIR)/include
40 OPENSSL_LINK = -L$(OPENSSLDIR)/$(lib) $(CC_LD_DYNPATH)$(OPENSSLDIR)/$(lib)
41 @@ -1989,10 +1985,6 @@ endif
42 git-%$X: %.o GIT-LDFLAGS $(GITLIBS)
43 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
45 -git-imap-send$X: imap-send.o $(IMAP_SEND_BUILDDEPS) GIT-LDFLAGS $(GITLIBS)
46 - $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
47 - $(LIBS) $(IMAP_SEND_LDFLAGS)
49 git-http-fetch$X: http.o http-walker.o http-fetch.o GIT-LDFLAGS $(GITLIBS)
50 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
51 $(CURL_LIBCURL) $(LIBS)
52 @@ -2312,10 +2304,11 @@ endif
53 bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \
54 execdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \
55 { test "$$bindir/" = "$$execdir/" || \
56 - for p in git$X $(filter $(install_bindir_programs),$(ALL_PROGRAMS)); do \
57 + for p in $(filter $(install_bindir_programs),$(ALL_PROGRAMS)); do \
58 $(RM) "$$execdir/$$p" && \
59 test -z "$(NO_INSTALL_HARDLINKS)$(NO_CROSS_DIRECTORY_HARDLINKS)" && \
60 ln "$$bindir/$$p" "$$execdir/$$p" 2>/dev/null || \
61 + ln -s git "$$execdir/$$p" 2>/dev/null || \
62 cp "$$bindir/$$p" "$$execdir/$$p" || exit; \
67 @@ -142,5 +142,10 @@ extern int cmd_verify_pack(int argc, con
68 extern int cmd_show_ref(int argc, const char **argv, const char *prefix);
69 extern int cmd_pack_refs(int argc, const char **argv, const char *prefix);
70 extern int cmd_replace(int argc, const char **argv, const char *prefix);
71 +extern int cmd_daemon(int argc, char **argv, const char *prefix);
72 +extern int cmd_fast_import(int argc, char **argv, const char *prefix);
73 +extern int cmd_imap_send(int argc, char **argv, const char *prefix);
74 +extern int cmd_shell(int argc, char **argv, const char *prefix);
75 +extern int cmd_upload_pack(int argc, char **argv, const char *prefix);
79 +++ b/builtin/daemon.c
81 +#include "../daemon.c"
83 +++ b/builtin/fast-import.c
85 +#include "../fast-import.c"
87 +++ b/builtin/imap-send.c
89 +#include "../imap-send.c"
93 +#include "../shell.c"
95 +++ b/builtin/upload-pack.c
97 +#include "../upload-pack.c"
100 @@ -1178,7 +1178,7 @@ static int serve(struct string_list *lis
101 return service_loop(&socklist);
104 -int main(int argc, char **argv)
105 +int cmd_daemon(int argc, char **argv, const char *prefix)
108 struct string_list listen_addr = STRING_LIST_INIT_NODUP;
109 @@ -1374,6 +1374,7 @@ int main(int argc, char **argv)
110 write_file(pid_file, "%"PRIuMAX, (uintmax_t) getpid());
112 /* prepare argv for serving-processes */
113 + argv_array_push(&cld_argv, "git"); /* git-daemon */
114 argv_array_push(&cld_argv, argv[0]); /* git-daemon */
115 argv_array_push(&cld_argv, "--serve");
116 for (i = 1; i < argc; ++i)
119 @@ -3381,7 +3381,7 @@ static void parse_argv(void)
123 -int main(int argc, char **argv)
124 +int cmd_fast_import(int argc, char **argv, const char *prefix)
130 @@ -307,11 +307,11 @@ static int handle_alias(int *argcp, cons
134 - int (*fn)(int, const char **, const char *);
135 + int (*fn)(int, char **, const char *);
139 -static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
140 +static int run_builtin(struct cmd_struct *p, int argc, char **argv)
144 @@ -392,6 +392,7 @@ static struct cmd_struct commands[] = {
145 { "config", cmd_config, RUN_SETUP_GENTLY },
146 { "count-objects", cmd_count_objects, RUN_SETUP },
147 { "credential", cmd_credential, RUN_SETUP_GENTLY },
148 + { "daemon", cmd_daemon },
149 { "describe", cmd_describe, RUN_SETUP },
150 { "diff", cmd_diff },
151 { "diff-files", cmd_diff_files, RUN_SETUP | NEED_WORK_TREE },
152 @@ -410,6 +411,7 @@ static struct cmd_struct commands[] = {
153 { "grep", cmd_grep, RUN_SETUP_GENTLY },
154 { "hash-object", cmd_hash_object },
155 { "help", cmd_help },
156 + { "imap-send", cmd_imap_send },
157 { "index-pack", cmd_index_pack, RUN_SETUP_GENTLY },
158 { "init", cmd_init_db, NO_SETUP },
159 { "init-db", cmd_init_db, NO_SETUP },
160 @@ -459,6 +461,7 @@ static struct cmd_struct commands[] = {
161 { "revert", cmd_revert, RUN_SETUP | NEED_WORK_TREE },
162 { "rm", cmd_rm, RUN_SETUP },
163 { "send-pack", cmd_send_pack, RUN_SETUP },
164 + { "shell", cmd_shell },
165 { "shortlog", cmd_shortlog, RUN_SETUP_GENTLY | USE_PAGER },
166 { "show", cmd_show, RUN_SETUP },
167 { "show-branch", cmd_show_branch, RUN_SETUP },
168 @@ -476,6 +479,7 @@ static struct cmd_struct commands[] = {
169 { "update-server-info", cmd_update_server_info, RUN_SETUP },
170 { "upload-archive", cmd_upload_archive },
171 { "upload-archive--writer", cmd_upload_archive_writer },
172 + { "upload-pack", cmd_upload_pack },
173 { "var", cmd_var, RUN_SETUP_GENTLY },
174 { "verify-commit", cmd_verify_commit, RUN_SETUP },
175 { "verify-pack", cmd_verify_pack },
178 @@ -1494,7 +1494,7 @@ static int curl_append_msgs_to_imap(stru
182 -int main(int argc, char **argv)
183 +int cmd_imap_send(int argc, char **argv, const char *prefix)
185 struct strbuf all_msgs = STRBUF_INIT;
189 @@ -138,7 +138,7 @@ static struct commands {
193 -int main(int argc, char **argv)
194 +int cmd_shell(int argc, char **argv, const char *prefix)
197 const char **user_argv;
200 @@ -820,7 +820,7 @@ static int upload_pack_config(const char
201 return parse_hide_refs_config(var, value, "uploadpack");
204 -int main(int argc, char **argv)
205 +int cmd_upload_pack(int argc, char **argv, const char *prefix)