All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Johannes Sixt <j6t@kdbg.org>
Cc: "Carlo Marcelo Arenas Belón" <carenas@gmail.com>,
	"Nicolas Pitre" <nico@fluxnic.net>,
	"Carlo Marcelo Arenas Belón via GitGitGadget"
	<gitgitgadget@gmail.com>,
	git@vger.kernel.org
Subject: Re: [PATCH] progress: pay attention to (customized) delay time
Date: Mon, 25 Aug 2025 10:00:25 -0700	[thread overview]
Message-ID: <xmqq349fs5ee.fsf@gitster.g> (raw)
In-Reply-To: <2d56de10-f829-4bc8-9c76-76eab6b137ae@kdbg.org> (Johannes Sixt's message of "Sun, 24 Aug 2025 17:31:18 +0200")

Johannes Sixt <j6t@kdbg.org> writes:

> Subject: [PATCH] progress: pay attention to (customized) delay time
> ...
> until zero is reached. Due to the frequency of the calls, this happens
> without an observable delay in practice, so that the effective delay is
> always just one second.
> ...
> Since we have not had any complaints that the delay of one second is
> too short nor that GIT_PROGRESS_DELAY is ignored, people seem to be
> comfortable with the status quo. Therefore, set the default to 1 to
> keep the current behavior.

OK.  This is documenting the established behaviour, which makes
sense.

>  	struct strbuf *counters_sb = &progress->counters_sb;
>  	int show_update = 0;
> +	sig_atomic_t update = progress_update;

It is somewhat misleading to use sig_atomic_t for "update", which is
never updated via the signal handler.  It confused me a bit during
my initial reading.  If it were

	int update = !!progress_update;

it would have made it more obvious what is going on, at least to me.
In any case, I think it is an excellent idea to clear the global one
first ...

>  	int last_count_len = counters_sb->len;
>  
> -	if (progress->delay && (!progress_update || --progress->delay))
> +	progress_update = 0;

..., while remembering the fact that progress_update was originally
set or unset, and consistently use the latter in the remainder of
the function, like ...

> +	if (progress->delay && (!update || --progress->delay))
>  		return;

... this one and everywhere below (omitted from quote).

Thanks.


  reply	other threads:[~2025-08-25 17:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-23 13:22 [PATCH 0/2] progress: replace setitimer() with alarm() Carlo Marcelo Arenas Belón via GitGitGadget
2025-08-23 13:22 ` [PATCH 1/2] " Carlo Marcelo Arenas Belón via GitGitGadget
2025-08-23 13:22 ` [PATCH 2/2] progress: add a shutting down state to the SIGALRM handler Carlo Marcelo Arenas Belón via GitGitGadget
2025-08-23 16:24 ` [PATCH 0/2] progress: replace setitimer() with alarm() Johannes Sixt
2025-08-23 19:38   ` Carlo Marcelo Arenas Belón
2025-08-23 19:55     ` Johannes Sixt
2025-08-23 21:33   ` Junio C Hamano
2025-08-23 21:47     ` Junio C Hamano
2025-08-23 22:03     ` Johannes Sixt
2025-08-24 15:31       ` [PATCH] progress: pay attention to (customized) delay time Johannes Sixt
2025-08-25 17:00         ` Junio C Hamano [this message]
2025-08-25 18:11           ` Carlo Marcelo Arenas Belón
2025-08-25 18:50             ` Junio C Hamano
2025-08-25 19:16               ` [PATCH v2] " Johannes Sixt
2025-08-25 22:52                 ` Junio C Hamano
2025-08-24 16:11       ` [PATCH 0/2] progress: replace setitimer() with alarm() Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq349fs5ee.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=carenas@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitgitgadget@gmail.com \
    --cc=j6t@kdbg.org \
    --cc=nico@fluxnic.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.