From: Junio C Hamano Date: Thu, 23 Feb 2012 00:17:22 GMT Subject: Re: [PATCHv3 1/5] refs: add match_pattern() Message-ID: <7v62ey8ktp.fsf@alter.siamese.dyndns.org> In-Reply-To: <20120222234733.GD2410@tgrennan-laptop> Tom Grennan writes: > Yes, I tried to minimize change but the conversion of argv's to > string_list's won't add that much. How about _not_ using string_list? After all, string_list is not just a collection of strings, but is a table to hold strings with attributes. I thought argv_array is more appropriate abstraction for the purpose of your patch. >> ref_match_pattern("refs/heads/master", >> ["maste?", NULL], >> ["refs/heads/", NULL], >> (REF_MATCH_FNM_PATH|REF_MATCH_LEADING)); >> >>Note that the above "ref_match_pattern()" gives the same "flags" for the >>call to match_one() for elements in both positive and negative array and >>it is very deliberate. See review comment to [3/5] for the reasoning. > > OK, I think that I understand, but please confirm, you'd expect no output in > the above example, right? "maste?" would match with FNM_PATHNAME with "refs/heads/master" but the negative "refs/heads/" matches with it, so yeah, I expect that the function would return false.