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.

208 lines
6.7 KiB

  1. --- a/Makefile
  2. +++ b/Makefile
  3. @@ -574,16 +574,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. @@ -945,6 +936,11 @@ BUILTIN_OBJS += builtin/verify-pack.o
  19. BUILTIN_OBJS += builtin/verify-tag.o
  20. BUILTIN_OBJS += builtin/worktree.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. @@ -1128,7 +1124,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. @@ -2006,10 +2002,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. $(CURL_LIBCURL) $(LIBS)
  47. @@ -2332,10 +2324,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. @@ -142,5 +142,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. @@ -1178,7 +1178,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. @@ -1374,6 +1374,7 @@ int main(int argc, char **argv)
  103. write_file(pid_file, "%"PRIuMAX, (uintmax_t) getpid());
  104. /* prepare argv for serving-processes */
  105. + argv_array_push(&cld_argv, "git"); /* git-daemon */
  106. argv_array_push(&cld_argv, argv[0]); /* git-daemon */
  107. argv_array_push(&cld_argv, "--serve");
  108. for (i = 1; i < argc; ++i)
  109. --- a/fast-import.c
  110. +++ b/fast-import.c
  111. @@ -3381,7 +3381,7 @@ static void parse_argv(void)
  112. read_marks();
  113. }
  114. -int main(int argc, char **argv)
  115. +int cmd_fast_import(int argc, char **argv, const char *prefix)
  116. {
  117. unsigned int i;
  118. --- a/git.c
  119. +++ b/git.c
  120. @@ -313,11 +313,11 @@ static int handle_alias(int *argcp, cons
  121. struct cmd_struct {
  122. const char *cmd;
  123. - int (*fn)(int, const char **, const char *);
  124. + int (*fn)(int, char **, const char *);
  125. int option;
  126. };
  127. -static int run_builtin(struct cmd_struct *p, int argc, const char **argv)
  128. +static int run_builtin(struct cmd_struct *p, int argc, char **argv)
  129. {
  130. int status, help;
  131. struct stat st;
  132. @@ -398,6 +398,7 @@ static struct cmd_struct commands[] = {
  133. { "config", cmd_config, RUN_SETUP_GENTLY },
  134. { "count-objects", cmd_count_objects, RUN_SETUP },
  135. { "credential", cmd_credential, RUN_SETUP_GENTLY },
  136. + { "daemon", cmd_daemon },
  137. { "describe", cmd_describe, RUN_SETUP },
  138. { "diff", cmd_diff },
  139. { "diff-files", cmd_diff_files, RUN_SETUP | NEED_WORK_TREE },
  140. @@ -416,6 +417,7 @@ static struct cmd_struct commands[] = {
  141. { "grep", cmd_grep, RUN_SETUP_GENTLY },
  142. { "hash-object", cmd_hash_object },
  143. { "help", cmd_help },
  144. + { "imap-send", cmd_imap_send },
  145. { "index-pack", cmd_index_pack, RUN_SETUP_GENTLY },
  146. { "init", cmd_init_db },
  147. { "init-db", cmd_init_db },
  148. @@ -465,6 +467,7 @@ static struct cmd_struct commands[] = {
  149. { "revert", cmd_revert, RUN_SETUP | NEED_WORK_TREE },
  150. { "rm", cmd_rm, RUN_SETUP },
  151. { "send-pack", cmd_send_pack, RUN_SETUP },
  152. + { "shell", cmd_shell },
  153. { "shortlog", cmd_shortlog, RUN_SETUP_GENTLY | USE_PAGER },
  154. { "show", cmd_show, RUN_SETUP },
  155. { "show-branch", cmd_show_branch, RUN_SETUP },
  156. @@ -482,6 +485,7 @@ static struct cmd_struct commands[] = {
  157. { "update-server-info", cmd_update_server_info, RUN_SETUP },
  158. { "upload-archive", cmd_upload_archive },
  159. { "upload-archive--writer", cmd_upload_archive_writer },
  160. + { "upload-pack", cmd_upload_pack },
  161. { "var", cmd_var, RUN_SETUP_GENTLY },
  162. { "verify-commit", cmd_verify_commit, RUN_SETUP },
  163. { "verify-pack", cmd_verify_pack },
  164. --- a/imap-send.c
  165. +++ b/imap-send.c
  166. @@ -1494,7 +1494,7 @@ static int curl_append_msgs_to_imap(stru
  167. }
  168. #endif
  169. -int main(int argc, char **argv)
  170. +int cmd_imap_send(int argc, char **argv, const char *prefix)
  171. {
  172. struct strbuf all_msgs = STRBUF_INIT;
  173. int total;
  174. --- a/shell.c
  175. +++ b/shell.c
  176. @@ -138,7 +138,7 @@ static struct commands {
  177. { NULL },
  178. };
  179. -int main(int argc, char **argv)
  180. +int cmd_shell(int argc, char **argv, const char *prefix)
  181. {
  182. char *prog;
  183. const char **user_argv;
  184. --- a/upload-pack.c
  185. +++ b/upload-pack.c
  186. @@ -817,7 +817,7 @@ static int upload_pack_config(const char
  187. return parse_hide_refs_config(var, value, "uploadpack");
  188. }
  189. -int main(int argc, char **argv)
  190. +int cmd_upload_pack(int argc, char **argv, const char *prefix)
  191. {
  192. char *dir;
  193. int i;