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

Re: [PATCH 4/4] fsck: print progress

From
Jeff King <peff@peff.net>
Date
Nov 4, 2011, 20:14 UTC
Message-ID
<20111104201416.GA26591@sigill.intra.peff.net>
In-Reply-To
<1320421670-518-5-git-send-email-pclouds@gmail.com>
On Fri, Nov 04, 2011 at 10:47:50PM +0700, Nguyen Thai Ngoc Duy wrote:
Show 19 quoted lines
>  static int traverse_reachable(void)
>  {
> +	struct progress *progress = NULL;
> +	unsigned int nr = 0;
>  	int result = 0;
> +	if (show_progress)
> +		progress = start_progress_delay("Checking connectivity", 0, 0, 2);
>  	while (pending.nr) {
>  		struct object_array_entry *entry;
>  		struct object *obj;
> @@ -146,7 +152,9 @@ static int traverse_reachable(void)
>  		entry = pending.objects + --pending.nr;
>  		obj = entry->item;
>  		result |= traverse_one_object(obj);
> +		display_progress(progress, ++nr);
>  	}
> +	stop_progress(&progress);
>  	return !!result;
>  }

Thanks, this is a good place to put a progress meter, too. If you're feeling like pushing this topic further, "git prune" might be a good place for a progress meter, too. It does a similar traversal[1] for reachability, and makes "git gc" appear to hang at the end (we have nice progress meters for packing, but it takes something like 25 seconds to run "git prune" at the end, during which we are silent).

-Peff
[1] I wonder why fsck doesn't use mark_reachable from reachable.c.
Previous: Nguyễn Thái Ngọc DuyNext: Nguyen Thai Ngoc Duy
Message 6 of 10 in “fsck improvements”
  1. 0/4 fsck improvementsNguyễn Thái Ngọc Duy, Nov 4, 2011
  2. 1/4 fsck: return error code when verify_pack() goes wrongNguyễn Thái Ngọc Duy, Nov 4, 2011
  3. 2/4 Stop verify_packfile() as soon as an error occursNguyễn Thái Ngọc Duy, Nov 4, 2011
  4. 3/4 fsck: avoid reading every object twiceNguyễn Thái Ngọc Duy, Nov 4, 2011
  5. 4/4 fsck: print progressNguyễn Thái Ngọc Duy, Nov 4, 2011
  6. Jeff KingNov 4, 2011
  7. Nguyen Thai Ngoc DuyNov 5, 2011
  8. Junio C HamanoNov 4, 2011
  9. Nguyen Thai Ngoc DuyNov 5, 2011
  10. Junio C HamanoNov 5, 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.