4 +#include "../daemon.c"
6 +++ b/builtin/fast-import.c
8 +#include "../fast-import.c"
10 +++ b/builtin/http-backend.c
12 +#include "../http-backend.c"
14 +++ b/builtin/imap-send.c
16 +#include "../imap-send.c"
20 +#include "../shell.c"
22 +++ b/builtin/upload-pack.c
24 +#include "../upload-pack.c"
27 @@ -139,5 +139,11 @@ extern int cmd_verify_pack(int argc, con
28 extern int cmd_show_ref(int argc, const char **argv, const char *prefix);
29 extern int cmd_pack_refs(int argc, const char **argv, const char *prefix);
30 extern int cmd_replace(int argc, const char **argv, const char *prefix);
31 +extern int cmd_shell(int argc, char **argv, const char *prefix);
32 +extern int cmd_upload_pack(int argc, char **argv, const char *prefix);
33 +extern int cmd_http_backend(int argc, char **argv, const char *prefix);
34 +extern int cmd_daemon(int argc, char **argv, const char *prefix);
35 +extern int cmd_imap_send(int argc, char **argv, const char *prefix);
36 +extern int cmd_fast_import(int argc, const char **argv, const char *prefix);
41 @@ -963,7 +963,7 @@ static int serve(char *listen_addr, int
42 return service_loop(socknum, socklist);
45 -int main(int argc, char **argv)
46 +int cmd_daemon(int argc, char **argv, const char *prefix)
49 char *listen_addr = NULL;
52 @@ -2912,7 +2912,7 @@ static void parse_argv(void)
56 -int main(int argc, const char **argv)
57 +int cmd_fast_import(int argc, const char **argv, const char *prefix)
63 @@ -240,11 +240,11 @@ const char git_version_string[] = GIT_VE
67 - int (*fn)(int, const char **, const char *);
68 + int (*fn)(int, char **, const char *);
72 -static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
73 +static int run_builtin(struct cmd_struct *p, int argc, char **argv)
77 @@ -293,7 +293,7 @@ static int run_builtin(struct cmd_struct
81 -static void handle_internal_command(int argc, const char **argv)
82 +static void handle_internal_command(int argc, char **argv)
84 const char *cmd = argv[0];
85 static struct cmd_struct commands[] = {
86 @@ -405,6 +405,12 @@ static void handle_internal_command(int
87 { "verify-pack", cmd_verify_pack },
88 { "show-ref", cmd_show_ref, RUN_SETUP },
89 { "pack-refs", cmd_pack_refs, RUN_SETUP },
90 + { "shell", cmd_shell },
91 + { "upload-pack", cmd_upload_pack },
92 + { "http-backend", cmd_http_backend },
93 + { "daemon", cmd_daemon },
94 + { "imap-send", cmd_imap_send },
95 + { "fast-import", cmd_fast_import },
98 static const char ext[] = STRIP_EXTENSION;
101 @@ -540,7 +540,7 @@ static struct service_cmd {
102 {"POST", "/git-receive-pack$", service_rpc}
105 -int main(int argc, char **argv)
106 +int cmd_http_backend(int argc, char **argv, const char *prefix)
108 char *method = getenv("REQUEST_METHOD");
112 @@ -1528,7 +1528,7 @@ static int git_imap_config(const char *k
116 -int main(int argc, char **argv)
117 +int cmd_imap_send(int argc, char **argv, const char *prefix)
119 struct msg_data all_msgs, msg;
120 struct store *ctx = NULL;
123 @@ -398,12 +398,7 @@ EXTRA_PROGRAMS =
124 # ... and all the rest that could be moved out of bindir to gitexecdir
125 PROGRAMS += $(EXTRA_PROGRAMS)
127 -PROGRAM_OBJS += fast-import.o
128 -PROGRAM_OBJS += imap-send.o
129 -PROGRAM_OBJS += shell.o
130 PROGRAM_OBJS += show-index.o
131 -PROGRAM_OBJS += upload-pack.o
132 -PROGRAM_OBJS += http-backend.o
134 PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))
136 @@ -750,6 +745,12 @@ BUILTIN_OBJS += builtin/var.o
137 BUILTIN_OBJS += builtin/verify-pack.o
138 BUILTIN_OBJS += builtin/verify-tag.o
139 BUILTIN_OBJS += builtin/write-tree.o
140 +BUILTIN_OBJS += builtin/shell.o
141 +BUILTIN_OBJS += builtin/upload-pack.o
142 +BUILTIN_OBJS += builtin/http-backend.o
143 +BUILTIN_OBJS += builtin/daemon.o
144 +BUILTIN_OBJS += builtin/imap-send.o
145 +BUILTIN_OBJS += builtin/fast-import.o
147 GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
149 @@ -1244,10 +1245,9 @@ endif
152 ifndef NO_POSIX_ONLY_PROGRAMS
153 - PROGRAM_OBJS += daemon.o
156 - OPENSSL_LIBSSL = -lssl
159 BASIC_CFLAGS += -I$(OPENSSLDIR)/include
160 OPENSSL_LINK = -L$(OPENSSLDIR)/$(lib) $(CC_LD_DYNPATH)$(OPENSSLDIR)/$(lib)
161 @@ -1923,10 +1923,6 @@ endif
162 git-%$X: %.o $(GITLIBS)
163 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
165 -git-imap-send$X: imap-send.o $(GITLIBS)
166 - $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
167 - $(LIBS) $(OPENSSL_LINK) $(OPENSSL_LIBSSL) $(LIB_4_CRYPTO)
169 git-http-fetch$X: revision.o http.o http-walker.o http-fetch.o $(GITLIBS)
170 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
171 $(LIBS) $(CURL_LIBCURL)
172 @@ -2124,23 +2120,22 @@ endif
174 bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \
175 execdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \
176 + ln -s ../../bin/git "$$execdir/git" && \
177 { test "$$bindir/" = "$$execdir/" || \
178 - for p in git$X $(filter $(install_bindir_programs),$(ALL_PROGRAMS)); do \
179 + for p in $(filter $(install_bindir_programs),$(ALL_PROGRAMS)); do \
180 $(RM) "$$execdir/$$p" && \
181 test -z "$(NO_CROSS_DIRECTORY_HARDLINKS)" && \
182 - ln "$$bindir/$$p" "$$execdir/$$p" 2>/dev/null || \
183 + ln -s git "$$execdir/$$p" 2>/dev/null || \
184 cp "$$bindir/$$p" "$$execdir/$$p" || exit; \
187 for p in $(filter $(install_bindir_programs),$(BUILT_INS)); do \
188 $(RM) "$$bindir/$$p" && \
189 - ln "$$bindir/git$X" "$$bindir/$$p" 2>/dev/null || \
190 ln -s "git$X" "$$bindir/$$p" 2>/dev/null || \
191 cp "$$bindir/git$X" "$$bindir/$$p" || exit; \
193 for p in $(BUILT_INS); do \
194 $(RM) "$$execdir/$$p" && \
195 - ln "$$execdir/git$X" "$$execdir/$$p" 2>/dev/null || \
196 ln -s "git$X" "$$execdir/$$p" 2>/dev/null || \
197 cp "$$execdir/git$X" "$$execdir/$$p" || exit; \
201 @@ -45,7 +45,7 @@ static struct commands {
205 -int main(int argc, char **argv)
206 +int cmd_shell(int argc, char **argv, const char *prefix)
209 struct commands *cmd;
212 @@ -676,7 +676,7 @@ static void upload_pack(void)
216 -int main(int argc, char **argv)
217 +int cmd_upload_pack(int argc, char **argv, const char *prefix)