From: Junio C Hamano Date: Tue, 23 Aug 2016 21:47:29 GMT Subject: Re: [PATCH 2/7] clear_delta_base_cache_entry: use a more descriptive name Message-ID: In-Reply-To: <20160822215753.xy7hlho7niex3wpm@sigill.intra.peff.net> Jeff King writes: > The delta base cache entries are stored in a fixed-length > hash table. So the way to remove an entry is to "clear" the > slot in the table, and that is what this function does. > > However, the name is a leaky abstraction. If we were to > change the hash table implementation, it would no longer be > about "clearing". We should name it after _what_ it does, > not _how_ it does it. I.e., something like "remove" instead > of "clear". > > But that does not tell the whole story, either. The subtle > thing about this function is that it removes the entry, but > does not free the entry data. So a more descriptive name is > "detach"; we give ownership of the data buffer to the > caller, and remove any other resources. OK. Sounds sensible.