{"thread":{"id":"36662","subject":"[PATCH/RFC] Always auto-gc after calling a fast-import transport","startedAt":"2014-05-15T05:37:22Z","lastAt":"2014-05-16T13:08:09Z","messageCount":3,"participants":["Stepan Kasal","Felipe Contreras"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"241644","messageId":"20140515053722.GB12133@camelia.ucw.cz","threadId":"36662","inReplyTo":null,"subject":"[PATCH/RFC] Always auto-gc after calling a fast-import transport","fromName":"Stepan Kasal","fromEmail":"kasal@ucw.cz","sentAt":"2014-05-15T05:37:22Z","receivedAt":"2014-05-15T05:37:22Z","isPatch":true,"sender":{"key":"kasal@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/1481596?v=4"},"body":"From: Johannes Schindelin <johannes.schindelin@gmx.de>\nDate: Mon, 9 Apr 2012 13:04:35 -0500\n\nAfter importing anything with fast-import, we should always let the\ngarbage collector do its job, since the objects are written to disk\ninefficiently.\n\nThis brings down an initial import of http://selenic.com/hg from about\n230 megabytes to about 14.\n\nIn the future, we may want to make this configurable on a per-remote\nbasis, or maybe teach fast-import about it in the first place.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\nSigned-off-by: Stepan Kasal <kasal@ucw.cz>\n---\n\nHello,\nanother patch that waited in msysgit for 2 years.\nCould anyone on the list try to reproduce the performance problem\nthat triggered this?\n\nThanks,\n  Stepan\n\n transport-helper.c | 8 ++++++++\n 1 file changed, 8 insertions(+)\n\ndiff --git a/transport-helper.c b/transport-helper.c\nindex a01ea47..956b800 100644\n--- a/transport-helper.c\n+++ b/transport-helper.c\n@@ -14,6 +14,8 @@\n #include \"refs.h\"\n \n static int debug;\n+/* TODO: put somewhere sensible, e.g. git_transport_options? */\n+static int auto_gc = 1;\n \n struct helper_data {\n \tconst char *name;\n@@ -519,6 +521,12 @@ static int fetch_with_import(struct transport *transport,\n \t\t}\n \t}\n \tstrbuf_release(&buf);\n+\tif (auto_gc) {\n+\t\tconst char *argv_gc_auto[] = {\n+\t\t\t\"gc\", \"--auto\", \"--quiet\", NULL,\n+\t\t};\n+\t\trun_command_v_opt(argv_gc_auto, RUN_GIT_CMD);\n+\t}\n \treturn 0;\n }\n \n-- \n1.9.2.msysgit.0.335.gd2a461f\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"msysGit\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/d/optout.\n"},{"id":"241647","messageId":"53746523545d0_27ec161d2fc14@nysa.notmuch","threadId":"36662","inReplyTo":"20140515053722.GB12133@camelia.ucw.cz","subject":"RE: [PATCH/RFC] Always auto-gc after calling a fast-import transport","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2014-05-15T06:56:35Z","receivedAt":"2014-05-15T06:56:35Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Stepan Kasal wrote:\n> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n> Date: Mon, 9 Apr 2012 13:04:35 -0500\n> \n> After importing anything with fast-import, we should always let the\n> garbage collector do its job, since the objects are written to disk\n> inefficiently.\n\nI'm not sure how slow `git gc --auto` is with a totally unpacked\nrepository, but it guess it will be slow enough that some people might\nnot want to do the gc initially.\n\nNot many people have complained about the size of the repoitory after\ncloning, so I think it should be OK to let users call `git gc` when they\nwish to.\n\n-- \nFelipe Contreras\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"msysGit\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/d/optout.\n"},{"id":"241885","messageId":"53760db99f8ae_6899d4d2f8c6@nysa.notmuch","threadId":"36662","inReplyTo":"20140515053722.GB12133@camelia.ucw.cz","subject":"RE: [PATCH/RFC] Always auto-gc after calling a fast-import transport","fromName":"Felipe Contreras","fromEmail":"felipe.contreras@gmail.com","sentAt":"2014-05-16T13:08:09Z","receivedAt":"2014-05-16T13:08:09Z","isPatch":true,"sender":{"key":"felipe.contreras@gmail.com","avatar":"https://avatars.githubusercontent.com/u/8358?v=4"},"body":"Stepan Kasal wrote:\n> From: Johannes Schindelin <johannes.schindelin@gmx.de>\n> Date: Mon, 9 Apr 2012 13:04:35 -0500\n> \n> After importing anything with fast-import, we should always let the\n> garbage collector do its job, since the objects are written to disk\n> inefficiently.\n> \n> This brings down an initial import of http://selenic.com/hg from about\n> 230 megabytes to about 14.\n> \n> In the future, we may want to make this configurable on a per-remote\n> basis, or maybe teach fast-import about it in the first place.\n\nActually I tested this patch and it makes no difference. Before and\nafter the patch the repository size is exactly the same (and so is the\nrun-time).\n\nThat is because after the initial import there are no loose objects,\nevery thing is into one big pack, so `git gc --auto` does nothing.\n\n> Could anyone on the list try to reproduce the performance problem\n> that triggered this?\n\nI'd say this patch is not doing anything in recent versions of Git.\n\n-- \nFelipe Contreras\n\n-- \n-- \n*** Please reply-to-all at all times ***\n*** (do not pretend to know who is subscribed and who is not) ***\n*** Please avoid top-posting. ***\nThe msysGit Wiki is here: https://github.com/msysgit/msysgit/wiki - Github accounts are free.\n\nYou received this message because you are subscribed to the Google\nGroups \"msysGit\" group.\nTo post to this group, send email to msysgit@googlegroups.com\nTo unsubscribe from this group, send email to\nmsysgit+unsubscribe@googlegroups.com\nFor more options, and view previous threads, visit this group at\nhttp://groups.google.com/group/msysgit?hl=en_US?hl=en\n\n--- \nYou received this message because you are subscribed to the Google Groups \"msysGit\" group.\nTo unsubscribe from this group and stop receiving emails from it, send an email to msysgit+unsubscribe@googlegroups.com.\nFor more options, visit https://groups.google.com/d/optout.\n"}]}