Thread (14 messages) flat view 14 messages, 3 authors, 2016-06-15

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

From: Michael Haggerty <hidden>
Date: 2016-06-15 22:53:03

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
mhagger@alum.mit.edu
http://softwareswirl.blogspot.com/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help