On Thu, Sep 29, 2016 at 4:13 PM, Junio C Hamano <gitster@xxxxxxxxx> wrote: > > One thing that worries me is if we are ready to start accessing the > object store in all codepaths when we ask for DEFAULT_ABBREV. Yes. That was my main worry too. I also looked at just doing an explicit if (abbrev_commit && default_abbrev < 0) default_abbrev = get_default_abbrev(); and in many ways that would be nicer exactly because the point where this happens is then explicit, instead of being hidden behind that macro that may end up being done in random places. But it wasn't entirely obvious which all paths would need that initialization either, so on the whole it was very much a "six of one, half a dozen of the other" thing. As you say, my original patch had neither of those issues. It just stupidly re-did the loop over and over, and maybe the right thing to do is to have that original code, but just short-circuit the "over and over" behavior by just resetting default_abbrev to the value we do find. Linus