Git Mailing List Archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Toon Claes <toon@iotcl.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v2 1/7] progress: add function to set total
Date: Fri, 21 Feb 2025 02:43:08 -0500	[thread overview]
Message-ID: <20250221074308.GB1988395@coredump.intra.peff.net> (raw)
In-Reply-To: <20250219-toon-bundleuri-progress-v2-1-a84e7ffa921a@iotcl.com>

On Wed, Feb 19, 2025 at 03:30:19PM +0100, Toon Claes wrote:

> We're about to add the use of progress through curl. Although, curl
> doesn't know the total at the start of the download, but might receive
> this information in the Content-Length header when the download starts.
> 
> To allow users set the total size after calling start_progress(), add a
> function progress_set_total().

Makes sense.

> +void progress_set_total(struct progress *progress, uint64_t total)
> +{
> +	if (progress)
> +		progress->total = total;
> +}

I wondered if we'd need to do any other computation here (that would
have been done in start_progress() if we specified the total then). But
it looks like we don't look at progress->total until we're ready to
display something.

Would we want to call display_progress() or similar here, to update the
original view like:

  Working hard: 1<CR>

to:

  Working hard: 33% (1/3)<CR>

immediately, rather than waiting for more progress to be made? I guess
it probably doesn't matter that much in practice as we'd remain stale
for a brief period in most cases (particularly for transfers where we're
updating based on bytes received, which is a pretty small unit of work).

Plus I think it may be awkward, because we don't know whether to call
display_progress() or display_throughput().

-Peff

  reply	other threads:[~2025-02-21  7:43 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-08 12:44 [PATCH 0/4] bundle-uri: show progress when downloading from bundle URIs Toon Claes
2024-05-08 12:44 ` [PATCH 1/4] progress: add function to set total Toon Claes
2024-05-08 12:44 ` [PATCH 2/4] http: add the ability to log progress Toon Claes
2024-05-08 16:52   ` Eric Sunshine
2024-05-09 16:34   ` Jeff King
2024-05-09 16:51     ` Junio C Hamano
2024-05-09 17:04       ` Jeff King
2024-05-09 16:52   ` Jeff King
2024-05-08 12:44 ` [PATCH 3/4] remote-curl: optionally show progress for HTTP get Toon Claes
2024-05-08 22:29   ` Junio C Hamano
2024-05-08 12:44 ` [PATCH 4/4] bundle-uri: enable git-remote-https progress Toon Claes
2024-05-09 16:46   ` Jeff King
2025-02-14 11:26     ` Toon Claes
2025-02-21  7:36       ` Jeff King
2024-05-08 23:49 ` [PATCH 0/4] bundle-uri: show progress when downloading from bundle URIs Junio C Hamano
2025-02-19 14:30 ` [PATCH v2 0/7] Show " Toon Claes
2025-02-19 14:30   ` [PATCH v2 1/7] progress: add function to set total Toon Claes
2025-02-21  7:43     ` Jeff King [this message]
2025-02-19 14:30   ` [PATCH v2 2/7] progress: allow pure-throughput progress meters Toon Claes
2025-02-19 14:30   ` [PATCH v2 3/7] http: turn off curl signals Toon Claes
2025-02-19 14:30   ` [PATCH v2 4/7] http: add the ability to log progress Toon Claes
2025-02-19 14:30   ` [PATCH v2 5/7] remote-curl: optionally show progress for HTTP get Toon Claes
2025-02-19 14:30   ` [PATCH v2 6/7] bundle-uri: enable git-remote-https progress Toon Claes
2025-02-19 14:30   ` [PATCH v2 7/7] http: silence stderr when progress is enabled Toon Claes
2025-02-21  7:48     ` Jeff King

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=20250221074308.GB1988395@coredump.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=toon@iotcl.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).