Re: [PATCH 2/2] count-objects: report garbage files in .git/objects/pack directory too

2013-02-07 Thread Duy Nguyen
On Fri, Feb 8, 2013 at 1:12 AM, Junio C Hamano wrote: > Duy Nguyen writes: > >> I thought about that, but we may need to do extra stat() for loose >> garbage as well. As it is now, garbage is complained loudly, which >> gives me enough motivation to clean up, even without looking at how >> much d

Re: [PATCH 2/2] count-objects: report garbage files in .git/objects/pack directory too

2013-02-07 Thread Junio C Hamano
Duy Nguyen writes: > I thought about that, but we may need to do extra stat() for loose > garbage as well. As it is now, garbage is complained loudly, which > gives me enough motivation to clean up, even without looking at how > much disk space it uses. I wouldn't call a single line "garbage: 4"

Re: [PATCH 2/2] count-objects: report garbage files in .git/objects/pack directory too

2013-02-06 Thread Duy Nguyen
On Mon, Feb 04, 2013 at 10:16:23AM -0800, Junio C Hamano wrote: > I forgot to mention one more thing. Your report_pack_garbage() > special cases ".pack" to see if it is a regular file, but this loop > structure causes a regular file whose name ends with ".pack" but > without corresponding ".idx" f

Re: [PATCH 2/2] count-objects: report garbage files in .git/objects/pack directory too

2013-02-04 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > @@ -1024,11 +1035,15 @@ static void prepare_packed_git_one(char *objdir, int > local) > int namelen = strlen(de->d_name); > struct packed_git *p; > > - if (!has_extension(de->d_name, ".idx")) > + if (!has_exten

Re: [PATCH 2/2] count-objects: report garbage files in .git/objects/pack directory too

2013-02-04 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > The hook in prepare_packed_git_one is ugly, but I don't want to > duplicate the search file logic there in count-objects. Maybe I'm > wrong. In this particular case I do not think you are completely wrong; you are probably only two thirds wrong ;-) The idea to

[PATCH 2/2] count-objects: report garbage files in .git/objects/pack directory too

2013-02-04 Thread Nguyễn Thái Ngọc Duy
While it's unusual to have strange files in loose object database, .git/objects/pack/tmp_* is normal after a broken fetch and they can eat up a lot of disk space if the user does not pay attention. Report them. Signed-off-by: Nguyễn Thái Ngọc Duy --- The hook in prepare_packed_git_one is ugly, b