{"thread":{"id":"19695","subject":"[PATCH 19/23] http-push.c::fetch_symref(): use the new http API","startedAt":"2009-06-05T16:05:59Z","lastAt":"2009-06-06T07:20:18Z","messageCount":5,"participants":["Tay Ray Chuan","Jakub Narebski","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":23},"messages":[{"id":"115531","messageId":"20090606000559.483f22da.rctay89@gmail.com","threadId":"19695","inReplyTo":null,"subject":"[PATCH 19/23] http-push.c::fetch_symref(): use the new http API","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2009-06-05T16:05:59Z","receivedAt":"2009-06-05T16:05:59Z","isPatch":true,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"From:\tMike Hommey <mh@glandium.org>\nSubject: [WIP Patch 09/12] Use the new http API in fetch_symref()\nDate:\tSun, 18 Jan 2009 09:04:34 +0100\n\nSigned-off-by: Mike Hommey <mh@glandium.org>\nSigned-off-by: Tay Ray Chuan <rctay89@gmail.com>\n---\n http-push.c |   20 +++-----------------\n 1 files changed, 3 insertions(+), 17 deletions(-)\n\ndiff --git a/http-push.c b/http-push.c\nindex 455e0aa..1714e4e 100644\n--- a/http-push.c\n+++ b/http-push.c\n@@ -2029,27 +2029,13 @@ static void fetch_symref(const char *path, char **symref, unsigned char *sha1)\n {\n \tchar *url;\n \tstruct strbuf buffer = STRBUF_INIT;\n-\tstruct active_request_slot *slot;\n-\tstruct slot_results results;\n\n \turl = xmalloc(strlen(repo->url) + strlen(path) + 1);\n \tsprintf(url, \"%s%s\", repo->url, path);\n\n-\tslot = get_active_slot();\n-\tslot->results = &results;\n-\tcurl_easy_setopt(slot->curl, CURLOPT_FILE, &buffer);\n-\tcurl_easy_setopt(slot->curl, CURLOPT_WRITEFUNCTION, fwrite_buffer);\n-\tcurl_easy_setopt(slot->curl, CURLOPT_HTTPHEADER, NULL);\n-\tcurl_easy_setopt(slot->curl, CURLOPT_URL, url);\n-\tif (start_active_slot(slot)) {\n-\t\trun_active_slot(slot);\n-\t\tif (results.curl_result != CURLE_OK) {\n-\t\t\tdie(\"Couldn't get %s for remote symref\\n%s\",\n-\t\t\t    url, curl_errorstr);\n-\t\t}\n-\t} else {\n-\t\tdie(\"Unable to start remote symref request\");\n-\t}\n+\tif (http_get_strbuf(url, &buffer, 0) != HTTP_OK)\n+\t\tdie(\"Couldn't get %s for remote symref\\n%s\", url,\n+\t\t    curl_errorstr);\n \tfree(url);\n\n \tfree(*symref);\n--\n1.6.3.1\n"},{"id":"115567","messageId":"m37hzq5rod.fsf@localhost.localdomain","threadId":"19695","inReplyTo":"20090606000559.483f22da.rctay89@gmail.com","subject":"Re: [PATCH 19/23] http-push.c::fetch_symref(): use the new http API","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2009-06-05T20:54:07Z","receivedAt":"2009-06-05T20:54:07Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Tay Ray Chuan <rctay89@gmail.com> writes:\n\n> From:\tMike Hommey <mh@glandium.org>\n> Subject: [WIP Patch 09/12] Use the new http API in fetch_symref()\n\nWhat is the subject of this patch:\n  \"http-push.c::fetch_symref(): use the new http API\"\nor\n  \"Use the new http API in fetch_symref()\"\n\n> Date:\tSun, 18 Jan 2009 09:04:34 +0100\n> \n> Signed-off-by: Mike Hommey <mh@glandium.org>\n> Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>\n> ---\n\nIf you wanted to note old subject, it would be better to put it in\ncomments (here).\n\n>  http-push.c |   20 +++-----------------\n>  1 files changed, 3 insertions(+), 17 deletions(-)\n> \n> diff --git a/http-push.c b/http-push.c\n> index 455e0aa..1714e4e 100644\n> --- a/http-push.c\n> +++ b/http-push.c\n> @@ -2029,27 +2029,13 @@ static void fetch_symref(const char *path, char **symref, unsigned char *sha1)\n>  {\n>  \tchar *url;\n>  \tstruct strbuf buffer = STRBUF_INIT;\n> -\tstruct active_request_slot *slot;\n> -\tstruct slot_results results;\n> \n>  \turl = xmalloc(strlen(repo->url) + strlen(path) + 1);\n>  \tsprintf(url, \"%s%s\", repo->url, path);\n> \n> -\tslot = get_active_slot();\n> -\tslot->results = &results;\n> -\tcurl_easy_setopt(slot->curl, CURLOPT_FILE, &buffer);\n> -\tcurl_easy_setopt(slot->curl, CURLOPT_WRITEFUNCTION, fwrite_buffer);\n> -\tcurl_easy_setopt(slot->curl, CURLOPT_HTTPHEADER, NULL);\n> -\tcurl_easy_setopt(slot->curl, CURLOPT_URL, url);\n> -\tif (start_active_slot(slot)) {\n> -\t\trun_active_slot(slot);\n> -\t\tif (results.curl_result != CURLE_OK) {\n> -\t\t\tdie(\"Couldn't get %s for remote symref\\n%s\",\n> -\t\t\t    url, curl_errorstr);\n> -\t\t}\n> -\t} else {\n> -\t\tdie(\"Unable to start remote symref request\");\n> -\t}\n> +\tif (http_get_strbuf(url, &buffer, 0) != HTTP_OK)\n> +\t\tdie(\"Couldn't get %s for remote symref\\n%s\", url,\n> +\t\t    curl_errorstr);\n>  \tfree(url);\n> \n>  \tfree(*symref);\n> --\n> 1.6.3.1\n> \n\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"115585","messageId":"be6fef0d0906051802n4f6d5df3g453b292787ed62d0@mail.gmail.com","threadId":"19695","inReplyTo":"m37hzq5rod.fsf@localhost.localdomain","subject":"Re: [PATCH 19/23] http-push.c::fetch_symref(): use the new http API","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2009-06-06T01:02:32Z","receivedAt":"2009-06-06T01:02:32Z","isPatch":true,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"Hi,\n\nOn Sat, Jun 6, 2009 at 4:54 AM, Jakub Narebski<jnareb@gmail.com> wrote:\n>> From: Mike Hommey <mh@glandium.org>\n>> Subject: [WIP Patch 09/12] Use the new http API in fetch_symref()\n>\n> What is the subject of this patch:\n>  \"http-push.c::fetch_symref(): use the new http API\"\n> or\n>  \"Use the new http API in fetch_symref()\"\n> [...]\n> If you wanted to note old subject, it would be better to put it in\n> comments (here).\n\nSince the title of the patch differed from Mike's original, I was\nafraid the attribution to the author's original patch was lost on the\nreader of the commit message, thus I added the original subject, in\naddition to the author and date, into the commit message.\n\nI didn't add the subject line in Mike's other patches, like patch #11,\nbecause the title of the original patch and the current one are the\nsame, so it's easy for readers to know what patch is being attributed\nto.\n\n-- \nCheers,\nRay Chuan\n"},{"id":"115606","messageId":"7vvdnadj0z.fsf@alter.siamese.dyndns.org","threadId":"19695","inReplyTo":"be6fef0d0906051802n4f6d5df3g453b292787ed62d0@mail.gmail.com","subject":"Re: [PATCH 19/23] http-push.c::fetch_symref(): use the new http API","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2009-06-06T05:32:28Z","receivedAt":"2009-06-06T05:32:28Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Tay Ray Chuan <rctay89@gmail.com> writes:\n\n> On Sat, Jun 6, 2009 at 4:54 AM, Jakub Narebski<jnareb@gmail.com> wrote:\n>>> From: Mike Hommey <mh@glandium.org>\n>>> Subject: [WIP Patch 09/12] Use the new http API in fetch_symref()\n>>\n>> What is the subject of this patch:\n>>  \"http-push.c::fetch_symref(): use the new http API\"\n>> or\n>>  \"Use the new http API in fetch_symref()\"\n>> [...]\n>> If you wanted to note old subject, it would be better to put it in\n>> comments (here).\n>\n> Since the title of the patch differed from Mike's original, I was\n> afraid the attribution to the author's original patch was lost on the\n> reader of the commit message, thus I added the original subject, in\n> addition to the author and date, into the commit message.\n\nPlease don't.\n\nIf you chose to use a better (in your opinion) subject from the original\none, we'd want to have that improved one in our commit.  The same thing if\nyou chose to rewrite the proposed commit log message, or the contents of\nthe patch, to add your own improvement.  That is what we review here, and\nif people think your submitted version is good, that is what we want to\nrecord as a commit.\n\nSo, in general we would want to see something like this:\n\n(1)     From: Tay Ray Chuan <rctay89@gmail.com>\n        Subject: [PATCH 19/23] http-push.c:fetch_symref(): use the new HTTP API\n\n(2)     From: Mike Hommey <mh@glandium.org>\n\n(3)     Now the contents of a file can be slurped into a strbuf with a single\n        call to http_get_strbuf(), use it to simplify fetch_symref().\n\n(4)     Signed-off-by: Mike Hommey <mh@glandium.org>\n        Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>\n(5)     ---\n(6)      This is based on Mike's earlier patch:\n\n         Subject: [WIP Patch 09/12] Use the new http API in fetch_symref()\n         Date:  Sun, 18 Jan 2009 09:04:34 +0100\n\n         I retitlted Mike's patch in order to ...\n         Also changed frotz and nitfol so that they distim doshes better...\n\n(7)     http-push.c |   20 +++-----------------\n         1 files changed, 3 insertions(+), 17 deletions(-)\n\n(8)     diff --git a/http-push.c b/http-push.c\n        ...\n\nThat is,\n\n    (1) RFC2822 headers your MUA gives us;\n\n    (2) In-body (fake)headers for From: if the author is different from\n        what (1) records.  If you are forwarding somebody else's patch\n        verbatim without modification, you may want to add Date: to keep\n        the original datestamp, but if you are sending a version with your\n        own improvements, we would rather use the Date: recorded in (1) in\n        the final commit.\n\n    (3) Proposed commit log message;\n\n    (4) Chain of Signed-off-by lines;\n\n    (5) Three-dash separator;\n\n    (6) Commentary to explain the history of the patch, and/or background\n        information if necessary,\n\n    (7) diffstat;\n\n    (8) the patch itself.\n\nThanks.\n"},{"id":"115608","messageId":"be6fef0d0906060020x1a3a03a6ya4e58de6c83854d0@mail.gmail.com","threadId":"19695","inReplyTo":"7vvdnadj0z.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 19/23] http-push.c::fetch_symref(): use the new http API","fromName":"Tay Ray Chuan","fromEmail":"rctay89@gmail.com","sentAt":"2009-06-06T07:20:18Z","receivedAt":"2009-06-06T07:20:18Z","isPatch":true,"sender":{"key":"rctay89@gmail.com","avatar":"https://avatars.githubusercontent.com/u/61553?v=4"},"body":"Hi,\n\nOn Sat, Jun 6, 2009 at 1:32 PM, Junio C Hamano<gitster@pobox.com> wrote:\n> Please don't.\n\nOk.\n\n>    (5) Three-dash separator;\n>\n>    (6) Commentary to explain the history of the patch, and/or background\n>        information if necessary,\n\nIs there anyway git can store and display these \"commentaries\"? I find\nmyself having to repeatedly write this.\n\n-- \nCheers,\nRay Chuan\n"}]}