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

Re: [PATCH] fsck: print progress

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 3, 2011, 19:43 UTC
Message-ID
<7vd3d9f0u8.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20111103193826.GB19483@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
> a little more readable, or even:
>
>   stop_progress_msg(&progress, p->next ? NULL : "done\n");
Yeah, this one looks neat.
Show 12 quoted lines
> But I almost wonder if it is worth factoring out the concept of a
> "progress group", where you would call it like:
>
>   progress = progress_group_start("Checking objects in pack", nr_packs);
>   for (p = packed_git; p; p = p->next) {
>           progress_group_next(progress, p->num_objects);
>           for (j = 0; j < num; j++) {
>                   fsck_sha1(p, j);
>                   display_progress(progress, j+1);
>           }
>   }
>   stop_progress(&progress);

Hmm, once you do this kind of thing I would expect two (or more) progress bars to be shown, something like:

	$ git fsck --progress
	checking packs: 3 of 7 (42% done)
        checking objects in pack: 12405 of 332340 (4% done)
Previous: Jeff KingNext: Jeff King
Message 9 of 21 in “long fsck time”
  1. Nguyen Thai Ngoc DuyNov 2, 2011
  2. Nguyen Thai Ngoc DuyNov 2, 2011
  3. Jeff KingNov 2, 2011
  4. Nguyen Thai Ngoc DuyNov 3, 2011
  5. fsck: print progressNguyễn Thái Ngọc Duy, Nov 3, 2011
  6. Jeff KingNov 3, 2011
  7. fsck: print progressNguyễn Thái Ngọc Duy, Nov 3, 2011
  8. Jeff KingNov 3, 2011
  9. Junio C HamanoNov 3, 2011
  10. Jeff KingNov 3, 2011
  11. Junio C HamanoNov 3, 2011
  12. Jeff KingNov 3, 2011
  13. Junio C HamanoNov 3, 2011
  14. Jeff KingNov 3, 2011
  15. fsck: print progressNguyễn Thái Ngọc Duy, Nov 4, 2011
  16. Stephen BoydNov 5, 2011
  17. Nguyen Thai Ngoc DuyNov 5, 2011
  18. Stephen BoydNov 5, 2011
  19. Junio C HamanoNov 5, 2011
  20. Nguyen Thai Ngoc DuyNov 6, 2011
  21. Junio C HamanoNov 6, 2011

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.