Re: [PATCH v2 22/27] struct ref_update: Rename field "ref_name" to "refname"
- From
Michael Haggerty <mhagger@alum.mit.edu>
- Date
- Apr 2, 2014, 05:11 UTC
- Message-ID
- <533B9BED.4050509@alum.mit.edu>
- In-Reply-To
- <xmqqha6czuzu.fsf@gitster.dls.corp.google.com>
On 04/01/2014 09:53 PM, Junio C Hamano wrote:
Show 20 quoted lines
> Michael Haggerty <mhagger@alum.mit.edu> writes: > >> This is consistent with the usual nomenclature. > > I am of two minds. > > Looking for "\(\.\|->\)ref_name" used to ignore refname fields of > other structures and let us focus on the ref_update structure. Yes, > there is the ref_lock structure that shares ref_name to contaminate > such a grep output already, but this change makes the output even > more noisy, as you have to now look for "\(\.\|->\)refname" which > would give you more hits from other unrelated structures. > > On the other hand, I do not like to name this to "update_refname" or > some nonsense like that, of course. A reference name field in a > "ref_update" structure shouldn't have to say that it is about > updating in its name; it should be known from the name of the > structure it appears in. > > So I dunno.
I prefer naming consistency but whatever.
When I want to find all users of a common identifier, I usually rename the identifier at its declaration (e.g., to "refnameXXX") and see where gcc flags errors. Or if I'm doing a lot of this sort of thing, I might even fire up Eclipse, which does a pretty good job of finding instances of a particular identifier throughout the code.
Michael
-- Michael Haggerty mhagger@alum.mit.edu http://softwareswirl.blogspot.com/