{"thread":{"id":"20309","subject":"[PATCH 3/3 v3] git-http-fetch: not a builtin","startedAt":"2009-07-31T05:26:43Z","lastAt":"2009-07-31T05:26:43Z","messageCount":1,"participants":["Daniel Barkalow"],"isPatch":true,"patchVersion":3,"patchTotal":3},"messages":[{"id":"119213","messageId":"alpine.LNX.2.00.0907310115240.2147@iabervon.org","threadId":"20309","inReplyTo":null,"subject":"[PATCH 3/3 v3] git-http-fetch: not a builtin","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2009-07-31T05:26:43Z","receivedAt":"2009-07-31T05:26:43Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"This splits up git-http-fetch so that it isn't built-in.\n\nIt also removes the general dependency on curl, because it is no\nlonger used by any built-in code. Because they are no longer LIB_OBJS,\nadd LIB_H to the dependencies of http-related object files, and remove\nhttp.h from the dependencies of transport.o\n\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\nSigned-off-by: Daniel Barkalow <barkalow@iabervon.org>\n---\nI think the dependency change fixes the random segfaults; http.o and \nhttp-walker.o wouldn't be rebuilt when needed without it, leading to \nincorrect builds after checking out this version after building a \ndifferent version.\n\n Makefile                             |   10 ++++++----\n git.c                                |    3 ---\n builtin-http-fetch.c => http-fetch.c |    5 ++++-\n 3 files changed, 10 insertions(+), 8 deletions(-)\n rename builtin-http-fetch.c => http-fetch.c (95%)\n\ndiff --git a/Makefile b/Makefile\nindex 35117fc..0ebf9dd 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -980,10 +980,7 @@ else\n \telse\n \t\tCURL_LIBCURL = -lcurl\n \tendif\n-\tBUILTIN_OBJS += builtin-http-fetch.o\n \tPROGRAMS += git-remote-http$X git-remote-https$X git-remote-ftp$X git-http-fetch$X\n-\tEXTLIBS += $(CURL_LIBCURL)\n-\tLIB_OBJS += http.o http-walker.o\n \tcurl_check := $(shell (echo 070908; curl-config --vernum) | sort -r | sed -ne 2p)\n \tifeq \"$(curl_check)\" \"070908\"\n \t\tifndef NO_EXPAT\n@@ -1486,8 +1483,13 @@ git-imap-send$X: imap-send.o $(GITLIBS)\n \t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n \t\t$(LIBS) $(OPENSSL_LINK) $(OPENSSL_LIBSSL)\n \n-http.o http-walker.o http-push.o transport.o: http.h\n+http.o http-walker.o http-push.o: http.h\n \n+http.o http-walker.o: $(LIB_H)\n+\n+git-http-fetch$X: revision.o http.o http-push.o $(GITLIBS)\n+\t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n+\t\t$(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)\n git-http-push$X: revision.o http.o http-push.o $(GITLIBS)\n \t$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \\\n \t\t$(LIBS) $(CURL_LIBCURL) $(EXPAT_LIBEXPAT)\ndiff --git a/git.c b/git.c\nindex 807d875..c1e8f05 100644\n--- a/git.c\n+++ b/git.c\n@@ -309,9 +309,6 @@ static void handle_internal_command(int argc, const char **argv)\n \t\t{ \"get-tar-commit-id\", cmd_get_tar_commit_id },\n \t\t{ \"grep\", cmd_grep, RUN_SETUP | USE_PAGER },\n \t\t{ \"help\", cmd_help },\n-#ifndef NO_CURL\n-\t\t{ \"http-fetch\", cmd_http_fetch, RUN_SETUP },\n-#endif\n \t\t{ \"init\", cmd_init_db },\n \t\t{ \"init-db\", cmd_init_db },\n \t\t{ \"log\", cmd_log, RUN_SETUP | USE_PAGER },\ndiff --git a/builtin-http-fetch.c b/http-fetch.c\nsimilarity index 95%\nrename from builtin-http-fetch.c\nrename to http-fetch.c\nindex f3e63d7..e8f44ba 100644\n--- a/builtin-http-fetch.c\n+++ b/http-fetch.c\n@@ -1,8 +1,9 @@\n #include \"cache.h\"\n #include \"walker.h\"\n \n-int cmd_http_fetch(int argc, const char **argv, const char *prefix)\n+int main(int argc, const char **argv)\n {\n+\tconst char *prefix;\n \tstruct walker *walker;\n \tint commits_on_stdin = 0;\n \tint commits;\n@@ -18,6 +19,8 @@ int cmd_http_fetch(int argc, const char **argv, const char *prefix)\n \tint get_verbosely = 0;\n \tint get_recover = 0;\n \n+\tprefix = setup_git_directory();\n+\n \tgit_config(git_default_config, NULL);\n \n \twhile (arg < argc && argv[arg][0] == '-') {\n-- \n1.6.4.rc3.25.gd5eff.dirty\n"}]}