On 1/26/2022 5:50 PM, Taylor Blau wrote: > On Wed, Jan 26, 2022 at 08:41:46AM +0000, Matthew John Cheetham via GitGitGadget wrote: >> + while ((e = readdir(dir)) != NULL) >> + if (!is_dot_or_dotdot(e->d_name) && >> + e->d_type == DT_DIR && strlen(e->d_name) == 2 && >> + !hex_to_bytes(&c, e->d_name, 1)) { > > What is this call to hex_to_bytes() for? I assume it's checking to make > sure the directory we're looking at is one of the shards of loose > objects. > > Similar to my suggestion on the previous patch, I think that we could > get rid of this function entirely and replace it with a call to > for_each_loose_file_in_objdir(). There is a possibility that there are files other than loose objects in these directories, so summarizing those counts might be helpful information. For example: if somehow .git/objects/00/ was full of a bunch of non-objects, it would still slow down Git commands that ask for a short-sha starting with "00". While this shouldn't be a normal case, the 'diagnose' command is built to help us find these extremely odd scenarios because they _have_ happened before (typically because of a VFS for Git bug taught us how to look for these situations). Thanks, -Stolee