Web lists-archives.com

Re: [PATCH] status: show progress bar if refreshing the index takes too long




On Fri, Sep 7, 2018 at 4:29 PM Derrick Stolee <stolee@xxxxxxxxx> wrote:
> On 9/7/2018 1:38 PM, Eric Sunshine wrote:
> > On Fri, Sep 7, 2018 at 11:51 AM Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx> wrote:
> >> +               if (progress)
> >> +                       display_progress(progress, i);
> >> +       if (progress)
> >> +               stop_progress(&progress);
> > Nit: Both display_progress() and stop_progress() behave sanely when
> > 'progress' is NULL, so no need for the conditional.
>
> Don't forget this one in preload-index.c:preload_index():
> +       if (pd.progress)
> +               stop_progress(&pd.progress);
>
> I found this extra one by creating the following rules in a Coccinelle script:
> - if (e) { stop_progress(&e); }
> - if (e) { display_progress(e, i); }
> Not sure if we want to put these in a .cocci script or not.

If so, we'd want to match display_throughput() and stop_progress_msg(), as well.