GithubHelp home page GithubHelp logo

Handle symlinks correctly about igittigitt HOT 4 CLOSED

bitranox avatar bitranox commented on June 25, 2024
Handle symlinks correctly

from igittigitt.

Comments (4)

bitranox avatar bitranox commented on June 25, 2024

ok - time to write some tests ;-)
I also believe that at the moment .gitignore files in the symlinked folder ( or symlinked .gitignore files) would not be handeled correctly.
So a full blown test matrix is needed ...

from igittigitt.

frthjf avatar frthjf commented on June 25, 2024

Thanks, that's very kind that you are willing to look into this. Let me know if you need any help with this.

from igittigitt.

ITProKyle avatar ITProKyle commented on June 25, 2024

I am encountering this issue as well but have a slightly different use case to the one described.

For my Python projects, I use poetry to manage virtual environments. I have virtualenvs.in-project=true set in my poetry.toml file. This results in the Python virtual environment being created in $PROJECT_DIR/.venv. In my $PROJECT_DIR/.gitignore file, I have a line containing .venv which causes git to ignore the contents of the directory.

When adding rules to igittigitt.IgnoreParser via .parse_rule_files(), I am passing $PROJECT_DIR as my base directory. Using pathlib.path.rglob("*"), I am recursively iterating over the context of my project directory and all it's subdirectories - passing each yielded object into .match() to ensure that it does not match before returning the object.

The results of this looks as I would expect except it contains 3 files within the $PROJECT_DIR/.venv directory: $PROJECT_DIR/.venv/bin/python3.9, $PROJECT_DIR/.venv/bin/python3, and $PROJECT_DIR/.venv/bin/python. All three of these files are symlinks to the Python executables on my system. They are created by virtualenv when the Python virtual environment is created so the existence of these files is unavoidable.

My current workaround is to add an additional rule (.add_rule("**/bin/python*", "/")). This is fine on my system while the integration of this library is under development but it's not something I want to rely on in the final release.

If no one else has time to look into fixing this, I'll circle back to see what I can work out.

from igittigitt.

bitranox avatar bitranox commented on June 25, 2024

ok, I will look into it - but will take some time....

from igittigitt.

Related Issues (9)

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.