Subject: Re: [PATCH v2 22/27] struct ref_update: Rename field "ref_name" to "refname"

From: Michael Haggerty <[email-masked]>
Date: Wed, 02 Apr 2014 07:11:09 +0200

On 04/01/2014 09:53 PM, Junio C Hamano wrote:
> Michael Haggerty <[email-masked]> 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
[email-masked]
http://softwareswirl.blogspot.com/