{"thread":{"id":"20258","subject":"[PATCH 3/3 v2] git-http-fetch: not a builtin","startedAt":"2009-07-28T06:08:53Z","lastAt":"2009-07-28T18:05:49Z","messageCount":3,"participants":["Daniel Barkalow","Johannes Schindelin"],"isPatch":true,"patchVersion":2,"patchTotal":3},"messages":[{"id":"118925","messageId":"alpine.LNX.2.00.0907280207480.2147@iabervon.org","threadId":"20258","inReplyTo":null,"subject":"[PATCH 3/3 v2] git-http-fetch: not a builtin","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2009-07-28T06:08:53Z","receivedAt":"2009-07-28T06:08:53Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"From: Linus Torvalds <torvalds@linux-foundation.org>\n\nThis 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.\n\nSigned-off-by: Linus Torvalds <torvalds@linux-foundation.org>\nSigned-off-by: Daniel Barkalow <barkalow@iabervon.org>\n---\n Makefile                             |    8 ++++----\n git.c                                |    3 ---\n builtin-http-fetch.c => http-fetch.c |    5 ++++-\n 3 files changed, 8 insertions(+), 8 deletions(-)\n rename builtin-http-fetch.c => http-fetch.c (95%)\n\ndiff --git a/Makefile b/Makefile\nindex d3dd2ed..3425336 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -979,10 +979,7 @@ else\n \telse\n \t\tCURL_LIBCURL = -lcurl\n \tendif\n-\tBUILTIN_OBJS += builtin-http-fetch.o\n-\tPROGRAMS += git-shim-curl$X\n-\tEXTLIBS += $(CURL_LIBCURL)\n-\tLIB_OBJS += http.o http-walker.o\n+\tPROGRAMS += git-shim-curl$X git-http-fetch$X\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@@ -1487,6 +1484,9 @@ git-imap-send$X: imap-send.o $(GITLIBS)\n \n http.o http-walker.o http-push.o transport.o: http.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.rc2.13.ga9762.dirty\n"},{"id":"118958","messageId":"alpine.DEB.1.00.0907281520150.8306@pacific.mpi-cbg.de","threadId":"20258","inReplyTo":"alpine.LNX.2.00.0907280207480.2147@iabervon.org","subject":"Re: [PATCH 3/3 v2] git-http-fetch: not a builtin","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2009-07-28T13:23:11Z","receivedAt":"2009-07-28T13:23:11Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 28 Jul 2009, Daniel Barkalow wrote:\n\n> From: Linus Torvalds <torvalds@linux-foundation.org>\n> \n> This splits up git-http-fetch so that it isn't built-in.\n> \n> It also removes the general dependency on curl, because it is no\n> longer used by any built-in code.\n> \n> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>\n> Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>\n> ---\n\nI think there is something missing that was not needed in Linus' original \npatch:\n\n> diff --git a/Makefile b/Makefile\n> index d3dd2ed..3425336 100644\n> --- a/Makefile\n> +++ b/Makefile\n> @@ -979,10 +979,7 @@ else\n>  \telse\n>  \t\tCURL_LIBCURL = -lcurl\n>  \tendif\n> -\tBUILTIN_OBJS += builtin-http-fetch.o\n> -\tPROGRAMS += git-shim-curl$X\n> -\tEXTLIBS += $(CURL_LIBCURL)\n> -\tLIB_OBJS += http.o http-walker.o\n> +\tPROGRAMS += git-shim-curl$X git-http-fetch$X\n\nSo now, http is all excluded from libgit.a.  Okay.\n\n> @@ -1487,6 +1484,9 @@ git-imap-send$X: imap-send.o $(GITLIBS)\n>  \n>  http.o http-walker.o http-push.o transport.o: http.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\nAnd git-http-fetch is linked to libcurl.  But why is git-shim-curl not \nlinked to libcurl?  I can only guess (as I am running out of time) that \ngit-shim-curl (in addition to having a doubly horrible name) has _no idea_ \nabout curl?  So why does it exist in the first place?  Should not rather \n\"git http-fetch\" be turned _into_ that helper (albeit with a much better \nname)?\n\nCiao,\nDscho\n"},{"id":"118977","messageId":"alpine.LNX.2.00.0907281400100.2147@iabervon.org","threadId":"20258","inReplyTo":"alpine.DEB.1.00.0907281520150.8306@pacific.mpi-cbg.de","subject":"Re: [PATCH 3/3 v2] git-http-fetch: not a builtin","fromName":"Daniel Barkalow","fromEmail":"barkalow@iabervon.org","sentAt":"2009-07-28T18:05:49Z","receivedAt":"2009-07-28T18:05:49Z","isPatch":true,"sender":{"key":"barkalow@iabervon.org","avatar":"https://avatars.githubusercontent.com/u/55364219?v=4"},"body":"On Tue, 28 Jul 2009, Johannes Schindelin wrote:\n\n> Hi,\n> \n> On Tue, 28 Jul 2009, Daniel Barkalow wrote:\n> \n> > From: Linus Torvalds <torvalds@linux-foundation.org>\n> > \n> > This splits up git-http-fetch so that it isn't built-in.\n> > \n> > It also removes the general dependency on curl, because it is no\n> > longer used by any built-in code.\n> > \n> > Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>\n> > Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>\n> > ---\n> \n> I think there is something missing that was not needed in Linus' original \n> patch:\n> \n> > diff --git a/Makefile b/Makefile\n> > index d3dd2ed..3425336 100644\n> > --- a/Makefile\n> > +++ b/Makefile\n> > @@ -979,10 +979,7 @@ else\n> >  \telse\n> >  \t\tCURL_LIBCURL = -lcurl\n> >  \tendif\n> > -\tBUILTIN_OBJS += builtin-http-fetch.o\n> > -\tPROGRAMS += git-shim-curl$X\n> > -\tEXTLIBS += $(CURL_LIBCURL)\n> > -\tLIB_OBJS += http.o http-walker.o\n> > +\tPROGRAMS += git-shim-curl$X git-http-fetch$X\n> \n> So now, http is all excluded from libgit.a.  Okay.\n> \n> > @@ -1487,6 +1484,9 @@ git-imap-send$X: imap-send.o $(GITLIBS)\n> >  \n> >  http.o http-walker.o http-push.o transport.o: http.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> \n> And git-http-fetch is linked to libcurl.  But why is git-shim-curl not \n> linked to libcurl?\n\nIt is linked to libcurl. Like git-http-push, it was already not relying on \nEXTLIBS including -lcurl.\n\n\t-Daniel\n*This .sig left intentionally blank*\n"}]}