Thread (1 message) 1 message, 1 author, 2016-06-15

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:56:03

Nguyễn Thái Ngọc Duy  [off-list ref] 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 use a customizable function pointer to allow it do extra
work is probably fine, but adding three identical calls and continue
is a bad taste.  Just have one callsite for the error path and do
not hesitate to jump to it with 'goto'.

I do not think failure to add_packed_git() should be treated the
same way as other cases where the files readdir() found are truly
garbage, by the way.

I also wonder, especially because you are enumerating the temporary
pack files in .git/objects/pack/, if it make more sense to account
for their sizes as well.  After all, you would end up doing stat()
for a common case of files with ".pack" suffix---doing so for all of
them shouldn't be too bad.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help