{"thread":{"id":"17523","subject":"[PATCH] http-push.c: get_remote_object_url() is only used under USE_CURL_MULTI","startedAt":"2009-02-03T06:45:56Z","lastAt":"2009-02-03T10:40:16Z","messageCount":3,"participants":["Junio C Hamano","Mike Hommey","Tay Ray Chuan"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"102928","messageId":"7v8woodnmj.fsf@gitster.siamese.dyndns.org","threadId":"17523","inReplyTo":null,"subject":"[PATCH] http-push.c: get_remote_object_url() is only used under USE_CURL_MULTI","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-02-03T06:45:56Z","receivedAt":"2009-02-03T06:45:56Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Otherwise -Wunused-function (which is implied by -Wall) triggers.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n\nI think this patch is probably a bit on the wrong side of the borderline,\nin that it *happens to be* that get_remote_object_url() is used by nobody\nin non-multi codepath right now, but it is entirely possible that future\ncode clean-up can benefit from its use.  But without this patch,, the file\ndoes not compile for me (I compile everything with \"-Werror -Wall\").\n\n http-push.c |   15 ++++++++-------\n 1 files changed, 8 insertions(+), 7 deletions(-)\n\ndiff --git a/http-push.c b/http-push.c\nindex ba5cc32..203c075 100644\n--- a/http-push.c\n+++ b/http-push.c\n@@ -218,13 +218,6 @@ static void append_remote_object_url(struct strbuf *buf, const char *url,\n \t\tstrbuf_addf(buf, \"%s\", hex+2);\n }\n \n-static char *get_remote_object_url(const char *url, const char *hex, int only_two_digit_prefix)\n-{\n-\tstruct strbuf buf = STRBUF_INIT;\n-\tappend_remote_object_url(&buf, url, hex, only_two_digit_prefix);\n-\treturn strbuf_detach(&buf, NULL);\n-}\n-\n static void finish_request(struct transfer_request *request);\n static void release_request(struct transfer_request *request);\n \n@@ -237,6 +230,14 @@ static void process_response(void *callback_data)\n }\n \n #ifdef USE_CURL_MULTI\n+\n+static char *get_remote_object_url(const char *url, const char *hex, int only_two_digit_prefix)\n+{\n+\tstruct strbuf buf = STRBUF_INIT;\n+\tappend_remote_object_url(&buf, url, hex, only_two_digit_prefix);\n+\treturn strbuf_detach(&buf, NULL);\n+}\n+\n static size_t fwrite_sha1_file(void *ptr, size_t eltsize, size_t nmemb,\n \t\t\t       void *data)\n {\n-- \n1.6.1.2.343.g53117\n"},{"id":"102930","messageId":"20090203065457.GA8466@glandium.org","threadId":"17523","inReplyTo":"7v8woodnmj.fsf@gitster.siamese.dyndns.org","subject":"Re: [PATCH] http-push.c: get_remote_object_url() is only used under USE_CURL_MULTI","fromName":"Mike Hommey","fromEmail":"mh@glandium.org","sentAt":"2009-02-03T06:54:57Z","receivedAt":"2009-02-03T06:54:57Z","isPatch":true,"sender":{"key":"mh@glandium.org","avatar":"https://avatars.githubusercontent.com/u/1038527?v=4"},"body":"On Mon, Feb 02, 2009 at 10:45:56PM -0800, Junio C Hamano wrote:\n> Otherwise -Wunused-function (which is implied by -Wall) triggers.\n> \n> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> ---\n> \n> I think this patch is probably a bit on the wrong side of the borderline,\n> in that it *happens to be* that get_remote_object_url() is used by nobody\n> in non-multi codepath right now, but it is entirely possible that future\n> code clean-up can benefit from its use.  But without this patch,, the file\n> does not compile for me (I compile everything with \"-Werror -Wall\").\n\nIf I recall correctly, http-push just doesn't work without curl-multi,\nso the correct fix would be to just disable http-push when\nUSE_CURL_MULTI is undefined.\n\nMike\n"},{"id":"102949","messageId":"be6fef0d0902030240g13672ef4uda2f70443ecfabf7@mail.gmail.com","threadId":"17523","inReplyTo":"20090203065457.GA8466@glandium.org","subject":"Re: [PATCH] http-push.c: get_remote_object_url() is only used under USE_CURL_MULTI","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2009-02-03T10:40:16Z","receivedAt":"2009-02-03T10:40:16Z","isPatch":true,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"On Tue, Feb 3, 2009 at 2:54 PM, Mike Hommey <mh@glandium.org> wrote:\n> If I recall correctly, http-push just doesn't work without curl-multi,\n> so the correct fix would be to just disable http-push when\n> USE_CURL_MULTI is undefined.\n\nIndeed, it dies on line 2253 (18d81a).\n\n2252 #ifndef USE_CURL_MULTI\n2253         die(\"git-push is not available for http/https repository\nwhen not compiled with USE_CURL_MULTI\");\n2254 #endif\n\n-- \nCheers,\nRay Chuan\n"}]}