Junio C Hamano <gits...@pobox.com> writes: >> I think the current name makes the following call very clear: > > It is still a strange name nevertheless.
Sorry for simply repeating "strange" without spelling out why in the previous message. This certainly is subjective and depends on your cultural background, but in our codebase, I tried to name functions after "what" they do and "why", rather than "how" they do so. In a way, it's the same kind of uneasiness I feel when I see variables named in hungarian notation. You would inspect the object and treat 'data' as a list and add to the object if it is a commit, and if_packed_commit_add_to_list() certainly is a name that describes all of that well, but does it give readers a good answer when they wonder why the function is doing so? You described with the name of the function how it collects commits that are in the pack, without explicitly saying that you want to collect packed commits and that is why you are inspecting for type and doing so only for commit (i.e. "if_packed_commit" part of the name) and why you are adding to a list.