[Bug 4710] New: Impossible to ignore files in a directory but not subdirectories

mercurial-bugs at selenic.com mercurial-bugs at selenic.com
Thu Jun 4 01:22:47 UTC 2015


http://bz.selenic.com/show_bug.cgi?id=4710

          Priority: normal
            Bug ID: 4710
                CC: mercurial-devel at selenic.com
          Assignee: bugzilla at selenic.com
           Summary: Impossible to ignore files in a directory but not
                    subdirectories
          Severity: feature
    Classification: Unclassified
                OS: Linux
          Reporter: hg at pewpew.net
          Hardware: PC
            Status: UNCONFIRMED
           Version: default branch
         Component: Mercurial
           Product: Mercurial

I tried adding this to my hgignore:
glob:foo/*

This ignored foo/bar.txt (yay!), but also foo/baz/qux.txt (boo!).  Ok, I guess
* is more like **, so I switched to re.  I wanted it anchored anyway, so this
is fine.

re:^foo/[^/]+$

Nope, no dice.  Still ignores foo/baz/qux.txt.  Turns out that if the ignore
matches any earlier component of the path, then the entire subtree is ignored. 
So, while walking, it's constantly checking.  Here's what it looks to be doing
from a quick pdb session:

foo         =~ (?:^foo/[^/]+$): Nope, Descend.
foo/bar.txt =~ (?:^foo/[^/]+$): Yup, Skip.
foo/baz     =~ (?:^foo/[^/]+$): Yup, Skip.

(It never looks at foo/baz/qux.txt, because it skipped the entire foo/baz
subtree).

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Mercurial-devel mailing list