upgrade git package
[openwrt/svn-archive/archive.git] / net / git / patches / 110-convert_builtin.patch
1 --- /dev/null
2 +++ b/builtin/daemon.c
3 @@ -0,0 +1 @@
4 +#include "../daemon.c"
5 --- /dev/null
6 +++ b/builtin/fast-import.c
7 @@ -0,0 +1 @@
8 +#include "../fast-import.c"
9 --- /dev/null
10 +++ b/builtin/http-backend.c
11 @@ -0,0 +1 @@
12 +#include "../http-backend.c"
13 --- /dev/null
14 +++ b/builtin/imap-send.c
15 @@ -0,0 +1 @@
16 +#include "../imap-send.c"
17 --- /dev/null
18 +++ b/builtin/shell.c
19 @@ -0,0 +1 @@
20 +#include "../shell.c"
21 --- /dev/null
22 +++ b/builtin/upload-pack.c
23 @@ -0,0 +1 @@
24 +#include "../upload-pack.c"
25 --- a/builtin.h
26 +++ b/builtin.h
27 @@ -143,5 +143,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);
37
38 #endif
39 --- a/daemon.c
40 +++ b/daemon.c
41 @@ -1043,7 +1043,7 @@ static int serve(struct string_list *lis
42 return service_loop(&socklist);
43 }
44
45 -int main(int argc, char **argv)
46 +int cmd_daemon(int argc, char **argv, const char *prefix)
47 {
48 int listen_port = 0;
49 struct string_list listen_addr = STRING_LIST_INIT_NODUP;
50 --- a/fast-import.c
51 +++ b/fast-import.c
52 @@ -3242,7 +3242,7 @@ static void parse_argv(void)
53 read_marks();
54 }
55
56 -int main(int argc, const char **argv)
57 +int cmd_fast_import(int argc, const char **argv, const char *prefix)
58 {
59 unsigned int i;
60
61 --- a/git.c
62 +++ b/git.c
63 @@ -251,11 +251,11 @@ const char git_version_string[] = GIT_VE
64
65 struct cmd_struct {
66 const char *cmd;
67 - int (*fn)(int, const char **, const char *);
68 + int (*fn)(int, char **, const char *);
69 int option;
70 };
71
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)
74 {
75 int status, help;
76 struct stat st;
77 @@ -308,7 +308,7 @@ static int run_builtin(struct cmd_struct
78 return 0;
79 }
80
81 -static void handle_internal_command(int argc, const char **argv)
82 +static void handle_internal_command(int argc, char **argv)
83 {
84 const char *cmd = argv[0];
85 static struct cmd_struct commands[] = {
86 @@ -322,10 +322,9 @@ static void handle_internal_command(int
87 { "bundle", cmd_bundle, RUN_SETUP_GENTLY },
88 { "cat-file", cmd_cat_file, RUN_SETUP },
89 { "check-attr", cmd_check_attr, RUN_SETUP },
90 - { "check-ref-format", cmd_check_ref_format },
91 { "checkout", cmd_checkout, RUN_SETUP | NEED_WORK_TREE },
92 - { "checkout-index", cmd_checkout_index,
93 - RUN_SETUP | NEED_WORK_TREE},
94 + { "checkout-index", cmd_checkout_index, RUN_SETUP | NEED_WORK_TREE},
95 + { "check-ref-format", cmd_check_ref_format },
96 { "cherry", cmd_cherry, RUN_SETUP },
97 { "cherry-pick", cmd_cherry_pick, RUN_SETUP | NEED_WORK_TREE },
98 { "clean", cmd_clean, RUN_SETUP | NEED_WORK_TREE },
99 @@ -334,12 +333,14 @@ static void handle_internal_command(int
100 { "commit-tree", cmd_commit_tree, RUN_SETUP },
101 { "config", cmd_config, RUN_SETUP_GENTLY },
102 { "count-objects", cmd_count_objects, RUN_SETUP },
103 + { "daemon", cmd_daemon },
104 { "describe", cmd_describe, RUN_SETUP },
105 { "diff", cmd_diff },
106 { "diff-files", cmd_diff_files, RUN_SETUP | NEED_WORK_TREE },
107 { "diff-index", cmd_diff_index, RUN_SETUP },
108 { "diff-tree", cmd_diff_tree, RUN_SETUP },
109 { "fast-export", cmd_fast_export, RUN_SETUP },
110 + { "fast-import", cmd_fast_import },
111 { "fetch", cmd_fetch, RUN_SETUP },
112 { "fetch-pack", cmd_fetch_pack, RUN_SETUP },
113 { "fmt-merge-msg", cmd_fmt_merge_msg, RUN_SETUP },
114 @@ -352,6 +353,8 @@ static void handle_internal_command(int
115 { "grep", cmd_grep, RUN_SETUP_GENTLY },
116 { "hash-object", cmd_hash_object },
117 { "help", cmd_help },
118 + { "http-backend", cmd_http_backend },
119 + { "imap-send", cmd_imap_send },
120 { "index-pack", cmd_index_pack, RUN_SETUP_GENTLY },
121 { "init", cmd_init_db },
122 { "init-db", cmd_init_db },
123 @@ -361,8 +364,8 @@ static void handle_internal_command(int
124 { "ls-tree", cmd_ls_tree, RUN_SETUP },
125 { "mailinfo", cmd_mailinfo },
126 { "mailsplit", cmd_mailsplit },
127 - { "merge", cmd_merge, RUN_SETUP | NEED_WORK_TREE },
128 { "merge-base", cmd_merge_base, RUN_SETUP },
129 + { "merge", cmd_merge, RUN_SETUP | NEED_WORK_TREE },
130 { "merge-file", cmd_merge_file, RUN_SETUP_GENTLY },
131 { "merge-index", cmd_merge_index, RUN_SETUP },
132 { "merge-ours", cmd_merge_ours, RUN_SETUP },
133 @@ -395,14 +398,15 @@ static void handle_internal_command(int
134 { "repo-config", cmd_repo_config, RUN_SETUP_GENTLY },
135 { "rerere", cmd_rerere, RUN_SETUP },
136 { "reset", cmd_reset, RUN_SETUP },
137 + { "revert", cmd_revert, RUN_SETUP | NEED_WORK_TREE },
138 { "rev-list", cmd_rev_list, RUN_SETUP },
139 { "rev-parse", cmd_rev_parse },
140 - { "revert", cmd_revert, RUN_SETUP | NEED_WORK_TREE },
141 { "rm", cmd_rm, RUN_SETUP },
142 { "send-pack", cmd_send_pack, RUN_SETUP },
143 + { "shell", cmd_shell },
144 { "shortlog", cmd_shortlog, RUN_SETUP_GENTLY | USE_PAGER },
145 - { "show", cmd_show, RUN_SETUP },
146 { "show-branch", cmd_show_branch, RUN_SETUP },
147 + { "show", cmd_show, RUN_SETUP },
148 { "show-ref", cmd_show_ref, RUN_SETUP },
149 { "stage", cmd_add, RUN_SETUP | NEED_WORK_TREE },
150 { "status", cmd_status, RUN_SETUP | NEED_WORK_TREE },
151 @@ -416,6 +420,7 @@ static void handle_internal_command(int
152 { "update-ref", cmd_update_ref, RUN_SETUP },
153 { "update-server-info", cmd_update_server_info, RUN_SETUP },
154 { "upload-archive", cmd_upload_archive },
155 + { "upload-pack", cmd_upload_pack },
156 { "var", cmd_var, RUN_SETUP_GENTLY },
157 { "verify-pack", cmd_verify_pack },
158 { "verify-tag", cmd_verify_tag, RUN_SETUP },
159 --- a/http-backend.c
160 +++ b/http-backend.c
161 @@ -540,7 +540,7 @@ static struct service_cmd {
162 {"POST", "/git-receive-pack$", service_rpc}
163 };
164
165 -int main(int argc, char **argv)
166 +int cmd_http_backend(int argc, char **argv, const char *prefix)
167 {
168 char *method = getenv("REQUEST_METHOD");
169 char *dir;
170 --- a/imap-send.c
171 +++ b/imap-send.c
172 @@ -1528,7 +1528,7 @@ static int git_imap_config(const char *k
173 return 0;
174 }
175
176 -int main(int argc, char **argv)
177 +int cmd_imap_send(int argc, char **argv, const char *prefix)
178 {
179 struct msg_data all_msgs, msg;
180 struct store *ctx = NULL;
181 --- a/Makefile
182 +++ b/Makefile
183 @@ -407,13 +407,7 @@ EXTRA_PROGRAMS =
184 # ... and all the rest that could be moved out of bindir to gitexecdir
185 PROGRAMS += $(EXTRA_PROGRAMS)
186
187 -PROGRAM_OBJS += daemon.o
188 -PROGRAM_OBJS += fast-import.o
189 -PROGRAM_OBJS += imap-send.o
190 -PROGRAM_OBJS += shell.o
191 PROGRAM_OBJS += show-index.o
192 -PROGRAM_OBJS += upload-pack.o
193 -PROGRAM_OBJS += http-backend.o
194
195 PROGRAMS += $(patsubst %.o,git-%$X,$(PROGRAM_OBJS))
196
197 @@ -771,6 +765,12 @@ BUILTIN_OBJS += builtin/var.o
198 BUILTIN_OBJS += builtin/verify-pack.o
199 BUILTIN_OBJS += builtin/verify-tag.o
200 BUILTIN_OBJS += builtin/write-tree.o
201 +BUILTIN_OBJS += builtin/shell.o
202 +BUILTIN_OBJS += builtin/upload-pack.o
203 +BUILTIN_OBJS += builtin/http-backend.o
204 +BUILTIN_OBJS += builtin/daemon.o
205 +BUILTIN_OBJS += builtin/imap-send.o
206 +BUILTIN_OBJS += builtin/fast-import.o
207
208 GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
209 EXTLIBS =
210 @@ -1289,7 +1289,7 @@ endif
211 EXTLIBS += -lz
212
213 ifndef NO_OPENSSL
214 - OPENSSL_LIBSSL = -lssl
215 + EXTLIBS += -lssl
216 ifdef OPENSSLDIR
217 BASIC_CFLAGS += -I$(OPENSSLDIR)/include
218 OPENSSL_LINK = -L$(OPENSSLDIR)/$(lib) $(CC_LD_DYNPATH)$(OPENSSLDIR)/$(lib)
219 @@ -1975,10 +1975,6 @@ endif
220 git-%$X: %.o $(GITLIBS)
221 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) $(LIBS)
222
223 -git-imap-send$X: imap-send.o $(GITLIBS)
224 - $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
225 - $(LIBS) $(OPENSSL_LINK) $(OPENSSL_LIBSSL) $(LIB_4_CRYPTO)
226 -
227 git-http-fetch$X: revision.o http.o http-walker.o http-fetch.o $(GITLIBS)
228 $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
229 $(LIBS) $(CURL_LIBCURL)
230 @@ -2192,23 +2188,22 @@ endif
231
232 bindir=$$(cd '$(DESTDIR_SQ)$(bindir_SQ)' && pwd) && \
233 execdir=$$(cd '$(DESTDIR_SQ)$(gitexec_instdir_SQ)' && pwd) && \
234 + ln -s ../../bin/git "$$execdir/git" && \
235 { test "$$bindir/" = "$$execdir/" || \
236 - for p in git$X $(filter $(install_bindir_programs),$(ALL_PROGRAMS)); do \
237 + for p in $(filter $(install_bindir_programs),$(ALL_PROGRAMS)); do \
238 $(RM) "$$execdir/$$p" && \
239 test -z "$(NO_CROSS_DIRECTORY_HARDLINKS)" && \
240 - ln "$$bindir/$$p" "$$execdir/$$p" 2>/dev/null || \
241 + ln -s git "$$execdir/$$p" 2>/dev/null || \
242 cp "$$bindir/$$p" "$$execdir/$$p" || exit; \
243 done; \
244 } && \
245 for p in $(filter $(install_bindir_programs),$(BUILT_INS)); do \
246 $(RM) "$$bindir/$$p" && \
247 - ln "$$bindir/git$X" "$$bindir/$$p" 2>/dev/null || \
248 ln -s "git$X" "$$bindir/$$p" 2>/dev/null || \
249 cp "$$bindir/git$X" "$$bindir/$$p" || exit; \
250 done && \
251 for p in $(BUILT_INS); do \
252 $(RM) "$$execdir/$$p" && \
253 - ln "$$execdir/git$X" "$$execdir/$$p" 2>/dev/null || \
254 ln -s "git$X" "$$execdir/$$p" 2>/dev/null || \
255 cp "$$execdir/git$X" "$$execdir/$$p" || exit; \
256 done && \
257 --- a/shell.c
258 +++ b/shell.c
259 @@ -129,7 +129,7 @@ static struct commands {
260 { NULL },
261 };
262
263 -int main(int argc, char **argv)
264 +int cmd_shell(int argc, char **argv, const char *prefix)
265 {
266 char *prog;
267 const char **user_argv;
268 --- a/upload-pack.c
269 +++ b/upload-pack.c
270 @@ -697,7 +697,7 @@ static void upload_pack(void)
271 }
272 }
273
274 -int main(int argc, char **argv)
275 +int cmd_upload_pack(int argc, char **argv, const char *prefix)
276 {
277 char *dir;
278 int i;