From: Junio C Hamano Date: Thu, 03 Nov 2011 19:43:59 GMT Subject: Re: [PATCH] fsck: print progress Message-ID: <7vd3d9f0u8.fsf@alter.siamese.dyndns.org> In-Reply-To: <20111103193826.GB19483@sigill.intra.peff.net> Jeff King writes: > a little more readable, or even: > > stop_progress_msg(&progress, p->next ? NULL : "done\n"); Yeah, this one looks neat. > 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)