2011/11/3 Jeff King <peff@xxxxxxxx>: > On Wed, Nov 02, 2011 at 07:10:26PM +0700, Nguyen Thai Ngoc Duy wrote: > >> On Wed, Nov 2, 2011 at 7:06 PM, Nguyen Thai Ngoc Duy <pclouds@xxxxxxxxx> wrote: >> > On git.git >> > >> > $ /usr/bin/time git fsck >> > 333.25user 4.28system 5:37.59elapsed 99%CPU (0avgtext+0avgdata >> > 420080maxresident)k >> > 0inputs+0outputs (0major+726560minor)pagefaults 0swaps >> > >> > That's really long time, perhaps we should print progress so users >> > know it's still running? >> >> Ahh.. --verbose. Sorry for the noise. Still good to show the number of >> checked objects though. > > fsck --verbose is _really_ verbose. It could probably stand to have some > progress meters sprinkled throughout. The patch below produces this on > my git.git repo: Yes, I wanted something like this. > $ git fsck > Checking object directories: 100% (256/256), done. > Verifying packs: 100% (7/7), done. > Checking objects (pack 1/7): 100% (241/241), done. > Checking objects (pack 2/7): 100% (176/176), done. > Checking objects (pack 3/7): 100% (312/312), done. > Checking objects (pack 4/7): 100% (252/252), done. > Checking objects (pack 5/7): 100% (353/353), done. > Checking objects (pack 6/7): 100% (375/375), done. > Checking objects (pack 7/7): 100% (171079/171079), done. Would be better if we only output one "Checking objects" line. > which gives reasonably smooth progress. The longest hang is that > "Verifying pack" 7 is slow (I believe it's doing a sha1 over the whole > thing). If you really wanted to get fancy, you could probably do a > throughput meter as we sha1 the whole contents. I'll give it a try. > Patch is below. It would need --{no-,}progress support on the command > line, and to check isatty(2) before it would be acceptable. Agreed on isatty(), though I think this output should be default (with maybe --quiet to silence it on tty). Other messages may be prepended with severity to indicate they are not progress output. -- Duy -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html