You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

219 lines
7.0 KiB

  1. --- a/Makefile
  2. +++ b/Makefile
  3. @@ -538,16 +538,7 @@ EXTRA_PROGRAMS =
  4. # ... and all the rest that could be moved out of bindir to gitexecdir
  5. PROGRAMS += $(EXTRA_PROGRAMS)
  6. -PROGRAM_OBJS += credential-store.o
  7. -PROGRAM_OBJS += daemon.o
  8. -PROGRAM_OBJS += fast-import.o
  9. PROGRAM_OBJS += http-backend.o
  10. -PROGRAM_OBJS += imap-send.o
  11. -PROGRAM_OBJS += sh-i18n--envsubst.o
  12. -PROGRAM_OBJS += shell.o
  13. -PROGRAM_OBJS += show-index.o
  14. -PROGRAM_OBJS += upload-pack.o
  15. -PROGRAM_OBJS += remote-testsvn.o
  16. # Binary suffix, set to .exe for Windows builds
  17. X =
  18. @@ -896,6 +887,11 @@ BUILTIN_OBJS += builtin/verify-commit.o
  19. BUILTIN_OBJS += builtin/verify-pack.o
  20. BUILTIN_OBJS += builtin/verify-tag.o
  21. BUILTIN_OBJS += builtin/write-tree.o
  22. +BUILTIN_OBJS += builtin/daemon.o
  23. +BUILTIN_OBJS += builtin/fast-import.o
  24. +BUILTIN_OBJS += builtin/imap-send.o
  25. +BUILTIN_OBJS += builtin/shell.o
  26. +BUILTIN_OBJS += builtin/upload-pack.o
  27. GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
  28. EXTLIBS =
  29. @@ -1070,7 +1066,7 @@ endif
  30. EXTLIBS += -lz
  31. ifndef NO_OPENSSL
  32. - OPENSSL_LIBSSL = -lssl
  33. + EXTLIBS += -lssl
  34. ifdef OPENSSLDIR
  35. BASIC_CFLAGS += -I$(OPENSSLDIR)/include
  36. OPENSSL_LINK = -L$(OPENSSLDIR)/$(lib) $(CC_LD_DYNPATH)$(OPENSSLDIR)/$(lib)
  37. @@ -1933,10 +1929,6 @@ endif
  38. git-%$X: %.o GIT-LDFLAGS $(GITLIBS)
  39. $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
  40. -git-imap-send$X: imap-send.o $(IMAP_SEND_BUILDDEPS) GIT-LDFLAGS $(GITLIBS)
  41. - $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
  42. - $(LIBS) $(IMAP_SEND_LDFLAGS)
  43. -
  44. git-http-fetch$X: http.o http-walker.o http-fetch.o GIT-LDFLAGS $(GITLIBS)
  45. $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
  46. $(LIBS) $(CURL_LIBCURL)
  47. @@ -2254,10 +2246,11 @@ endif
  48. bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \
  49. execdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \
  50. { test "$$bindir/" = "$$execdir/" || \
  51. - for p in git$X $(filter $(install_bindir_programs),$(ALL_PROGRAMS)); do \
  52. + for p in $(filter $(install_bindir_programs),$(ALL_PROGRAMS)); do \
  53. $(RM) "$$execdir/$$p" && \
  54. test -z "$(NO_INSTALL_HARDLINKS)$(NO_CROSS_DIRECTORY_HARDLINKS)" && \
  55. ln "$$bindir/$$p" "$$execdir/$$p" 2>/dev/null || \
  56. + ln -s git "$$execdir/$$p" 2>/dev/null || \
  57. cp "$$bindir/$$p" "$$execdir/$$p" || exit; \
  58. done; \
  59. } && \
  60. --- a/builtin.h
  61. +++ b/builtin.h
  62. @@ -138,5 +138,10 @@ extern int cmd_verify_pack(int argc, con
  63. extern int cmd_show_ref(int argc, const char **argv, const char *prefix);
  64. extern int cmd_pack_refs(int argc, const char **argv, const char *prefix);
  65. extern int cmd_replace(int argc, const char **argv, const char *prefix);
  66. +extern int cmd_daemon(int argc, char **argv, const char *prefix);
  67. +extern int cmd_fast_import(int argc, char **argv, const char *prefix);
  68. +extern int cmd_imap_send(int argc, char **argv, const char *prefix);
  69. +extern int cmd_shell(int argc, char **argv, const char *prefix);
  70. +extern int cmd_upload_pack(int argc, char **argv, const char *prefix);
  71. #endif
  72. --- /dev/null
  73. +++ b/builtin/daemon.c
  74. @@ -0,0 +1 @@
  75. +#include "../daemon.c"
  76. --- /dev/null
  77. +++ b/builtin/fast-import.c
  78. @@ -0,0 +1 @@
  79. +#include "../fast-import.c"
  80. --- /dev/null
  81. +++ b/builtin/imap-send.c
  82. @@ -0,0 +1 @@
  83. +#include "../imap-send.c"
  84. --- /dev/null
  85. +++ b/builtin/shell.c
  86. @@ -0,0 +1 @@
  87. +#include "../shell.c"
  88. --- /dev/null
  89. +++ b/builtin/upload-pack.c
  90. @@ -0,0 +1 @@
  91. +#include "../upload-pack.c"
  92. --- a/daemon.c
  93. +++ b/daemon.c
  94. @@ -1193,7 +1193,7 @@ static int serve(struct string_list *lis
  95. return service_loop(&socklist);
  96. }
  97. -int main(int argc, char **argv)
  98. +int cmd_daemon(int argc, char **argv, const char *prefix)
  99. {
  100. int listen_port = 0;
  101. struct string_list listen_addr = STRING_LIST_INIT_NODUP;
  102. @@ -1389,12 +1389,13 @@ int main(int argc, char **argv)
  103. store_pid(pid_file);
  104. /* prepare argv for serving-processes */
  105. - cld_argv = xmalloc(sizeof (char *) * (argc + 2));
  106. - cld_argv[0] = argv[0]; /* git-daemon */
  107. - cld_argv[1] = "--serve";
  108. + cld_argv = xmalloc(sizeof (char *) * (argc + 3));
  109. + cld_argv[0] = "git";
  110. + cld_argv[1] = argv[0]; /* daemon */
  111. + cld_argv[2] = "--serve";
  112. for (i = 1; i < argc; ++i)
  113. - cld_argv[i+1] = argv[i];
  114. - cld_argv[argc+1] = NULL;
  115. + cld_argv[i+2] = argv[i];
  116. + cld_argv[argc+2] = NULL;
  117. return serve(&listen_addr, listen_port, cred);
  118. }
  119. --- a/fast-import.c
  120. +++ b/fast-import.c
  121. @@ -3354,7 +3354,7 @@ static void parse_argv(void)
  122. read_marks();
  123. }
  124. -int main(int argc, char **argv)
  125. +int cmd_fast_import(int argc, char **argv, const char *prefix)
  126. {
  127. unsigned int i;
  128. --- a/git.c
  129. +++ b/git.c
  130. @@ -309,11 +309,11 @@ static int handle_alias(int *argcp, cons
  131. struct cmd_struct {
  132. const char *cmd;
  133. - int (*fn)(int, const char **, const char *);
  134. + int (*fn)(int, char **, const char *);
  135. int option;
  136. };
  137. -static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
  138. +static int run_builtin(struct cmd_struct *p, int argc, char **argv)
  139. {
  140. int status, help;
  141. struct stat st;
  142. @@ -393,6 +393,7 @@ static struct cmd_struct commands[] = {
  143. { "config", cmd_config, RUN_SETUP_GENTLY },
  144. { "count-objects", cmd_count_objects, RUN_SETUP },
  145. { "credential", cmd_credential, RUN_SETUP_GENTLY },
  146. + { "daemon", cmd_daemon },
  147. { "describe", cmd_describe, RUN_SETUP },
  148. { "diff", cmd_diff },
  149. { "diff-files", cmd_diff_files, RUN_SETUP | NEED_WORK_TREE },
  150. @@ -411,6 +412,7 @@ static struct cmd_struct commands[] = {
  151. { "grep", cmd_grep, RUN_SETUP_GENTLY },
  152. { "hash-object", cmd_hash_object },
  153. { "help", cmd_help },
  154. + { "imap-send", cmd_imap_send },
  155. { "index-pack", cmd_index_pack, RUN_SETUP_GENTLY },
  156. { "init", cmd_init_db, NO_SETUP },
  157. { "init-db", cmd_init_db, NO_SETUP },
  158. @@ -459,6 +461,7 @@ static struct cmd_struct commands[] = {
  159. { "revert", cmd_revert, RUN_SETUP | NEED_WORK_TREE },
  160. { "rm", cmd_rm, RUN_SETUP },
  161. { "send-pack", cmd_send_pack, RUN_SETUP },
  162. + { "shell", cmd_shell },
  163. { "shortlog", cmd_shortlog, RUN_SETUP_GENTLY | USE_PAGER },
  164. { "show", cmd_show, RUN_SETUP },
  165. { "show-branch", cmd_show_branch, RUN_SETUP },
  166. @@ -475,6 +478,7 @@ static struct cmd_struct commands[] = {
  167. { "update-server-info", cmd_update_server_info, RUN_SETUP },
  168. { "upload-archive", cmd_upload_archive },
  169. { "upload-archive--writer", cmd_upload_archive_writer },
  170. + { "upload-pack", cmd_upload_pack },
  171. { "var", cmd_var, RUN_SETUP_GENTLY },
  172. { "verify-commit", cmd_verify_commit, RUN_SETUP },
  173. { "verify-pack", cmd_verify_pack },
  174. --- a/imap-send.c
  175. +++ b/imap-send.c
  176. @@ -1484,7 +1484,7 @@ static int curl_append_msgs_to_imap(stru
  177. }
  178. #endif
  179. -int main(int argc, char **argv)
  180. +int cmd_imap_send(int argc, char **argv, const char *prefix)
  181. {
  182. struct strbuf all_msgs = STRBUF_INIT;
  183. int total;
  184. --- a/shell.c
  185. +++ b/shell.c
  186. @@ -138,7 +138,7 @@ static struct commands {
  187. { NULL },
  188. };
  189. -int main(int argc, char **argv)
  190. +int cmd_shell(int argc, char **argv, const char *prefix)
  191. {
  192. char *prog;
  193. const char **user_argv;
  194. --- a/upload-pack.c
  195. +++ b/upload-pack.c
  196. @@ -793,7 +793,7 @@ static int upload_pack_config(const char
  197. return parse_hide_refs_config(var, value, "uploadpack");
  198. }
  199. -int main(int argc, char **argv)
  200. +int cmd_upload_pack(int argc, char **argv, const char *prefix)
  201. {
  202. char *dir;
  203. int i;