git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 3/4] progress: Fix progress meters when dealing with lots of work

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 13, 2017, 05:24 UTC
Message-ID
<xmqqtvxy92ey.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<20171110173956.25105-4-newren@gmail.com>
Elijah Newren <newren@gmail.com> writes:
> Subject: Re: [PATCH 3/4] progress: Fix progress meters when dealing with lots of work
Style: s/Fix/fix/;
Show 9 quoted lines
> The possibility of setting merge.renameLimit beyond 2^16 raises the
> possibility that the values passed to progress can exceed 2^32.  For my
> usecase of interest, I only needed to pass a value a little over 2^31.  If
> I were only interested in fixing my usecase, I could have simply changed
> last_value from int to unsigned, and casted each of rename_dst_nr and
> rename_src_nr (in merge-recursive.c) from int to unsigned just before
> multiplying them.  However, as long as we're making changes to allow
> larger progress meters, we may as well make a little more room in general.
> Use uint64_t, because it "ought to be enough for anybody".  :-)

The middle part of the log message may waste more mental bandwidth of readers than it is worth. It might have gave you satisfaction to be able to vent, but don't (the place to do so is after the three dash lines).

I am not sure if we want all codepaths to do 64-bit math for progress meter, but let's see what others would think.

Show 11 quoted lines
> -static int display(struct progress *progress, unsigned n, const char *done)
> +static int display(struct progress *progress, uint64_t n, const char *done)
>  {
>  	const char *eol, *tp;
>  
> @@ -106,7 +106,7 @@ static int display(struct progress *progress, unsigned n, const char *done)
>  		if (percent != progress->last_percent || progress_update) {
>  			progress->last_percent = percent;
>  			if (is_foreground_fd(fileno(stderr)) || done) {
> -				fprintf(stderr, "%s: %3u%% (%u/%u)%s%s",
> +				fprintf(stderr, "%s: %3u%% (%lu/%lu)%s%s",

Are these (and there are probably other instances in this patch) %lu correct?

Previous: Elijah NewrenNext: Elijah Newren
Message 9 of 15 in “Fix issues with rename detection limits”
  1. 0/4 Fix issues with rename detection limitsElijah Newren, Nov 10, 2017
  2. 2/4 Remove silent clamp of renameLimitElijah Newren, Nov 10, 2017
  3. Stefan BellerNov 10, 2017
  4. Elijah NewrenNov 10, 2017
  5. brian m. carlsonNov 10, 2017
  6. Elijah NewrenNov 11, 2017
  7. brian m. carlsonNov 11, 2017
  8. 3/4 progress: Fix progress meters when dealing with lots of workElijah Newren, Nov 10, 2017
  9. Junio C HamanoNov 13, 2017
  10. Elijah NewrenNov 13, 2017
  11. Junio C HamanoNov 14, 2017
  12. 1/4 sequencer: Warn when internal merge may be suboptimal due to renameLimitElijah Newren, Nov 10, 2017
  13. Junio C HamanoNov 13, 2017
  14. 4/4 sequencer: Show rename progress during cherry picksElijah Newren, Nov 10, 2017
  15. Junio C HamanoNov 13, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.