{"thread":{"id":"24552","subject":"[PATCH] upload-pack: remove unused \"create_full_pack\" code in do_rev_list","startedAt":"2010-07-28T09:39:10Z","lastAt":"2010-07-28T17:23:12Z","messageCount":3,"participants":["Nguyễn Thái Ngọc Duy","Elijah Newren","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"146606","messageId":"1280309950-5597-1-git-send-email-pclouds@gmail.com","threadId":"24552","inReplyTo":null,"subject":"[PATCH] upload-pack: remove unused \"create_full_pack\" code in do_rev_list","fromName":"Nguyễn Thái Ngọc Duy","fromEmail":"pclouds@gmail.com","sentAt":"2010-07-28T09:39:10Z","receivedAt":"2010-07-28T09:39:10Z","isPatch":true,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"A bit of history in chronological order, the newest at bottom:\n\n- 80ccaa7 (upload-pack: Move the revision walker into a separate function.)\n   do_rev_list was introduced with create_full_pack argument\n\n- 21edd3f (upload-pack: Run rev-list in an asynchronous function.)\n   do_rev_list was now called by start_async, create_full_pack was\n   passed by rev_list.data\n\n- f0cea83 (Shift object enumeration out of upload-pack)\n   rev_list.data was now zero permanently. Creating full pack was\n   done by passing --all to pack-objects\n\n- ae6a560 (run-command: support custom fd-set in async)\n   rev_list.data = 0 was found out redudant and got rid of.\n\nGet rid of the code as well, for less headache while reading do_rev_list.\n\nSigned-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>\n---\n upload-pack.c |   29 ++++++++++++-----------------\n 1 files changed, 12 insertions(+), 17 deletions(-)\n\ndiff --git a/upload-pack.c b/upload-pack.c\nindex dc464d7..8f4c718 100644\n--- a/upload-pack.c\n+++ b/upload-pack.c\n@@ -105,7 +105,7 @@ static void show_edge(struct commit *commit)\n \tfprintf(pack_pipe, \"-%s\\n\", sha1_to_hex(commit->object.sha1));\n }\n \n-static int do_rev_list(int in, int out, void *create_full_pack)\n+static int do_rev_list(int in, int out, void *user_data)\n {\n \tint i;\n \tstruct rev_info revs;\n@@ -118,23 +118,18 @@ static int do_rev_list(int in, int out, void *create_full_pack)\n \tif (use_thin_pack)\n \t\trevs.edge_hint = 1;\n \n-\tif (create_full_pack) {\n-\t\tconst char *args[] = {\"rev-list\", \"--all\", NULL};\n-\t\tsetup_revisions(2, args, &revs, NULL);\n-\t} else {\n-\t\tfor (i = 0; i < want_obj.nr; i++) {\n-\t\t\tstruct object *o = want_obj.objects[i].item;\n-\t\t\t/* why??? */\n-\t\t\to->flags &= ~UNINTERESTING;\n-\t\t\tadd_pending_object(&revs, o, NULL);\n-\t\t}\n-\t\tfor (i = 0; i < have_obj.nr; i++) {\n-\t\t\tstruct object *o = have_obj.objects[i].item;\n-\t\t\to->flags |= UNINTERESTING;\n-\t\t\tadd_pending_object(&revs, o, NULL);\n-\t\t}\n-\t\tsetup_revisions(0, NULL, &revs, NULL);\n+\tfor (i = 0; i < want_obj.nr; i++) {\n+\t\tstruct object *o = want_obj.objects[i].item;\n+\t\t/* why??? */\n+\t\to->flags &= ~UNINTERESTING;\n+\t\tadd_pending_object(&revs, o, NULL);\n+\t}\n+\tfor (i = 0; i < have_obj.nr; i++) {\n+\t\tstruct object *o = have_obj.objects[i].item;\n+\t\to->flags |= UNINTERESTING;\n+\t\tadd_pending_object(&revs, o, NULL);\n \t}\n+\tsetup_revisions(0, NULL, &revs, NULL);\n \tif (prepare_revision_walk(&revs))\n \t\tdie(\"revision walk setup failed\");\n \tmark_edges_uninteresting(revs.commits, &revs, show_edge);\n-- \n1.7.1.rc1.69.g24c2f7\n"},{"id":"146636","messageId":"AANLkTi=OfoMd4Q8YJPLyYX3jTz+RBQZuV4chvzdG+_fG@mail.gmail.com","threadId":"24552","inReplyTo":"1280309950-5597-1-git-send-email-pclouds@gmail.com","subject":"Re: [PATCH] upload-pack: remove unused \"create_full_pack\" code in do_rev_list","fromName":"Elijah Newren","fromEmail":"newren@gmail.com","sentAt":"2010-07-28T16:47:19Z","receivedAt":"2010-07-28T16:47:19Z","isPatch":true,"sender":{"key":"newren@gmail.com","avatar":"https://avatars.githubusercontent.com/u/5455730?v=4"},"body":"Hi,\n\n2010/7/28 Nguyễn Thái Ngọc Duy <pclouds@gmail.com>:\n> A bit of history in chronological order, the newest at bottom:\n>\n> - 80ccaa7 (upload-pack: Move the revision walker into a separate function.)\n>   do_rev_list was introduced with create_full_pack argument\n>\n> - 21edd3f (upload-pack: Run rev-list in an asynchronous function.)\n>   do_rev_list was now called by start_async, create_full_pack was\n>   passed by rev_list.data\n>\n> - f0cea83 (Shift object enumeration out of upload-pack)\n>   rev_list.data was now zero permanently. Creating full pack was\n>   done by passing --all to pack-objects\n>\n> - ae6a560 (run-command: support custom fd-set in async)\n>   rev_list.data = 0 was found out redudant and got rid of.\n>\n> Get rid of the code as well, for less headache while reading do_rev_list.\n\nDefinitely a more detailed explanation than I gave for this patch\n(http://thread.gmane.org/gmane.comp.version-control.git/151667).  :-)\n"},{"id":"146639","messageId":"7vbp9r5xmn.fsf@alter.siamese.dyndns.org","threadId":"24552","inReplyTo":"1280309950-5597-1-git-send-email-pclouds@gmail.com","subject":"Re: [PATCH] upload-pack: remove unused \"create_full_pack\" code in do_rev_list","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-07-28T17:23:12Z","receivedAt":"2010-07-28T17:23:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nguyễn Thái Ngọc Duy <pclouds@gmail.com> writes:\n\n> A bit of history in chronological order, the newest at bottom:\n\nThanks.\n"}]}