Subject: Re: [PATCHv2 1/4] refs: add common refname_match_patterns()

From: Michael Haggerty <[email-masked]>
Date: Mon, 13 Feb 2012 06:00:40 +0100

On 02/11/2012 08:17 PM, Tom Grennan wrote:
> Yes, I didn't explicitly state that the precedence is the order written
> and in correctly described the first case. How about?
> 
> /**
>  * Returns in highest to lowest precedence:
>  *   1 with an empty patterns list
>  *   0 if refname fnmatch()es any ^ prefaced pattern
>  *   1 if refname fnmatch()es any other pattern
>  *   0 otherwise
>  */

Much better; thanks.

Please note that this choice of semantics limits its power.  For
example, if the rule were instead (like with gitattributes(5)) "if more
than one pattern matches a refname, a later pattern overrides an earlier
pattern", then one could do things like

    refs/remotes/*/* !refs/remotes/gitster/* refs/remotes/gitster/master

to include specific references within a hierarchy that is otherwise
excluded.

However, since rev-list apparently uses a rule more like the one that
you are proposing, it might be better to be consistent than to choose a
different convention.

Michael

-- 
Michael Haggerty
[email-masked]
http://softwareswirl.blogspot.com/