From: Jeff King <peff@peff.net>
To: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 4/4] fsck: print progress
Date: Fri, 4 Nov 2011 16:14:16 -0400 [thread overview]
Message-ID: <20111104201416.GA26591@sigill.intra.peff.net> (raw)
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:
> 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.
next prev parent reply other threads:[~2011-11-04 20:14 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-04 15:47 [PATCH 0/4] fsck improvements Nguyễn Thái Ngọc Duy
2011-11-04 15:47 ` [PATCH 1/4] fsck: return error code when verify_pack() goes wrong Nguyễn Thái Ngọc Duy
2011-11-04 15:47 ` [PATCH 2/4] Stop verify_packfile() as soon as an error occurs Nguyễn Thái Ngọc Duy
2011-11-04 15:47 ` [PATCH 3/4] fsck: avoid reading every object twice Nguyễn Thái Ngọc Duy
2011-11-04 15:47 ` [PATCH 4/4] fsck: print progress Nguyễn Thái Ngọc Duy
2011-11-04 20:14 ` Jeff King [this message]
2011-11-05 3:26 ` Nguyen Thai Ngoc Duy
2011-11-04 18:43 ` [PATCH 0/4] fsck improvements Junio C Hamano
2011-11-05 3:18 ` Nguyen Thai Ngoc Duy
2011-11-05 5:26 ` 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=20111104201416.GA26591@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=pclouds@gmail.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 NNTP newsgroup(s).