{"thread":{"id":"51349","subject":"[PATCH] delta-islands: respect progress flag","startedAt":"2019-06-20T08:58:35Z","lastAt":"2019-06-20T12:42:16Z","messageCount":2,"participants":["Jeff King","Derrick Stolee"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"377634","messageId":"20190620085832.GA5039@sigill.intra.peff.net","threadId":"51349","inReplyTo":null,"subject":"[PATCH] delta-islands: respect progress flag","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2019-06-20T08:58:32Z","receivedAt":"2019-06-20T08:58:35Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"The delta island code always prints \"Marked %d islands\", even if\nprogress has been suppressed with --no-progress or by sending stderr to\na non-tty.\n\nLet's pass a progress boolean to load_delta_islands(). We already do\nthe same thing for the progress meter in resolve_tree_islands().\n\nSigned-off-by: Jeff King <peff@peff.net>\n---\nArguably this should be a real progress meter that counts up, but I'm\nnot sure what it should be counting. Refs we analyzed? Islands found?\nUnless you have a ton of refs, it doesn't really matter, so I just\npunted on that part for now and only fixed the egregious bug. :)\n\n builtin/pack-objects.c | 2 +-\n delta-islands.c        | 5 +++--\n delta-islands.h        | 2 +-\n 3 files changed, 5 insertions(+), 4 deletions(-)\n\ndiff --git a/builtin/pack-objects.c b/builtin/pack-objects.c\nindex b2be8869c2..698c901523 100644\n--- a/builtin/pack-objects.c\n+++ b/builtin/pack-objects.c\n@@ -3134,7 +3134,7 @@ static void get_object_list(int ac, const char **av)\n \t\treturn;\n \n \tif (use_delta_islands)\n-\t\tload_delta_islands(the_repository);\n+\t\tload_delta_islands(the_repository, progress);\n \n \tif (prepare_revision_walk(&revs))\n \t\tdie(_(\"revision walk setup failed\"));\ndiff --git a/delta-islands.c b/delta-islands.c\nindex 2186bd0738..b959f6c380 100644\n--- a/delta-islands.c\n+++ b/delta-islands.c\n@@ -454,7 +454,7 @@ static void deduplicate_islands(struct repository *r)\n \tfree(list);\n }\n \n-void load_delta_islands(struct repository *r)\n+void load_delta_islands(struct repository *r, int progress)\n {\n \tisland_marks = kh_init_sha1();\n \tremote_islands = kh_init_str();\n@@ -463,7 +463,8 @@ void load_delta_islands(struct repository *r)\n \tfor_each_ref(find_island_for_ref, NULL);\n \tdeduplicate_islands(r);\n \n-\tfprintf(stderr, _(\"Marked %d islands, done.\\n\"), island_counter);\n+\tif (progress)\n+\t\tfprintf(stderr, _(\"Marked %d islands, done.\\n\"), island_counter);\n }\n \n void propagate_island_marks(struct commit *commit)\ndiff --git a/delta-islands.h b/delta-islands.h\nindex 3ac8045d8c..eb0f952629 100644\n--- a/delta-islands.h\n+++ b/delta-islands.h\n@@ -11,7 +11,7 @@ int in_same_island(const struct object_id *, const struct object_id *);\n void resolve_tree_islands(struct repository *r,\n \t\t\t  int progress,\n \t\t\t  struct packing_data *to_pack);\n-void load_delta_islands(struct repository *r);\n+void load_delta_islands(struct repository *r, int progress);\n void propagate_island_marks(struct commit *commit);\n int compute_pack_layers(struct packing_data *to_pack);\n \n-- \n2.22.0.732.g5402924b4b\n"},{"id":"377656","messageId":"77c41405-2270-1a48-2277-533f26ac1530@gmail.com","threadId":"51349","inReplyTo":"20190620085832.GA5039@sigill.intra.peff.net","subject":"Re: [PATCH] delta-islands: respect progress flag","fromName":"Derrick Stolee","fromEmail":"stolee@gmail.com","sentAt":"2019-06-20T12:42:13Z","receivedAt":"2019-06-20T12:42:16Z","isPatch":true,"sender":{"key":"stolee@gmail.com","avatar":"https://avatars.githubusercontent.com/u/570044?v=4"},"body":"On 6/20/2019 4:58 AM, Jeff King wrote:\n> The delta island code always prints \"Marked %d islands\", even if\n> progress has been suppressed with --no-progress or by sending stderr to\n> a non-tty.\n> \n> Let's pass a progress boolean to load_delta_islands(). We already do\n> the same thing for the progress meter in resolve_tree_islands().\n> \n> Signed-off-by: Jeff King <peff@peff.net>\n> ---\n> Arguably this should be a real progress meter that counts up, but I'm\n> not sure what it should be counting. Refs we analyzed? Islands found?\n> Unless you have a ton of refs, it doesn't really matter, so I just\n> punted on that part for now and only fixed the egregious bug. :)\n\nI agree that the first goal should be to stop writing 'progress' output\nto stderr when progress is disabled. Changing this to a full progress\nindicator can be done on top of this patch later (without changing the\nmethod prototypes again) if desired.\n\nLGTM.\n-Stolee\n\n"}]}