Coder Social home page Coder Social logo

Comments (5)

cpburnz avatar cpburnz commented on July 18, 2024

You're right, there is a discrepancy in the behavior. directoryG/* should match everything beneath directoryG which should include the files under directoryH.

from python-pathspec.

cpburnz avatar cpburnz commented on July 18, 2024

UPDATE: My evaluation in this comment was completely wrong and confused the issue.


I have not forgotten about this issue but I haven't had time to fix it yet.

I suspect the discrepancy is that a .gitignore does additional filtering beyond that of Git's wildmatch algorithm. If I fixed this in my implementation of wildmatch, it could unexpectedly change the results of anyone already using this for a purpose other than emulating .gitingore.

The core issue is that blacklisting files from an excluded directory is not currently implemented:

An optional prefix "!" which negates the pattern; any matching file excluded by a previous pattern will become included again. It is not possible to re-include a file if a parent directory of that file is excluded.

See: PATTERN FORMAT bullet 4.

from python-pathspec.

bukowa avatar bukowa commented on July 18, 2024

Hey is there any workaround?

from python-pathspec.

sausag3 avatar sausag3 commented on July 18, 2024

While I understand the dilemma above with breaking existing projects, as time goes on more projects are probably using this and probably a good number expect this to match the behavior Git has when trying to exactly match something as a .gitignore file. I've spent a few days on and off scratching my head trying to work out why files weren't being excluded properly (using Git itself as an interactive test to see what matching worked), only to find this open issue.

from python-pathspec.

cpburnz avatar cpburnz commented on July 18, 2024

This is now fixed and will be available in v0.10.0 when it is released.

from python-pathspec.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.