Re: [PATCH v4+ 3/4] count-objects: report garbage files in pack directory too

2013-02-15 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > prepare_packed_git_one() is modified to allow count-objects to hook a > report function to so we don't need to duplicate the pack searching > logic in count-objects.c. When report_pack_garbage is NULL, the > overhead is insignificant. > > The garbage is reported wi

[PATCH v4+ 3/4] count-objects: report garbage files in pack directory too

2013-02-15 Thread Nguyễn Thái Ngọc Duy
prepare_packed_git_one() is modified to allow count-objects to hook a report function to so we don't need to duplicate the pack searching logic in count-objects.c. When report_pack_garbage is NULL, the overhead is insignificant. The garbage is reported with warning() instead of error() in packed g

Re: [PATCH v4 3/4] count-objects: report garbage files in pack directory too

2013-02-14 Thread Junio C Hamano
Duy Nguyen writes: > On Wed, Feb 13, 2013 at 10:55 PM, Junio C Hamano wrote: >>> + default: >>> + return; >>> + } >>> + for (; first <= last; first++) >> >> This looks odd. If you use the usual last+1 convention between the >> caller and callee, you do not have to do thi

Re: [PATCH v4 3/4] count-objects: report garbage files in pack directory too

2013-02-14 Thread Duy Nguyen
On Wed, Feb 13, 2013 at 10:55 PM, Junio C Hamano wrote: >> + default: >> + return; >> + } >> + for (; first <= last; first++) > > This looks odd. If you use the usual last+1 convention between the > caller and callee, you do not have to do this, or call this function > wit

Re: [PATCH v4 3/4] count-objects: report garbage files in pack directory too

2013-02-13 Thread Junio C Hamano
Junio C Hamano writes: >> +if (has_extension(de->d_name, ".idx") || >> +has_extension(de->d_name, ".pack") || >> +has_extension(de->d_name, ".keep")) >> +string_list_append(&garbage, path); > > It might be OK to put .pack and .keep i

Re: [PATCH v4 3/4] count-objects: report garbage files in pack directory too

2013-02-13 Thread Junio C Hamano
Nguyễn Thái Ngọc Duy writes: > prepare_packed_git_one() is modified to allow count-objects to hook a > report function to so we don't need to duplicate the pack searching > logic in count-objects.c. When report_pack_garbage is NULL, the > overhead is insignificant. > > The garbage is reported wi

[PATCH v4 3/4] count-objects: report garbage files in pack directory too

2013-02-13 Thread Nguyễn Thái Ngọc Duy
prepare_packed_git_one() is modified to allow count-objects to hook a report function to so we don't need to duplicate the pack searching logic in count-objects.c. When report_pack_garbage is NULL, the overhead is insignificant. The garbage is reported with warning() instead of error() in packed g