[prev in list] [next in list] [prev in thread] [next in thread] 

List:       git
Subject:    Re: [WIP/PATCH v4 1/8] for-each-ref: extract helper functions out of grab_single_ref()
From:       Matthieu Moy <Matthieu.Moy () grenoble-inp ! fr>
Date:       2015-05-31 20:39:36
Message-ID: vpqvbf8jxbr.fsf () anie ! imag ! fr
[Download RAW message or body]

Junio C Hamano <gitster@pobox.com> writes:

> Karthik Nayak <karthik.188@gmail.com> writes:
>
>>  /*
>> + * Given a refname, return 1 if the refname matches with one of the patterns
>> + * while the pattern is a pathname like 'refs/tags' or 'refs/heads/master'
>> + * and so on, else return 0. Supports use of wild characters.
>> + */
>> +static int match_name_as_path(const char **pattern, const char *refname)
>> +{
>
> I wonder why this is not "match_refname", in other words, what the
> significance of "as path" part of the name?

Just match_refname may not carry all the semantics of the function,
which matches a prefix up to the end of string, or up to a / (but you
can't just be a prefix stopping in the middle of a word). To me, the
"_as_path" helped understanding the overall behavior of the function.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic