Giter VIP home page Giter VIP logo

Comments (2)

tony-iqlusion avatar tony-iqlusion commented on June 12, 2024

Can you provide a concrete use case?

To me it seems a bit unusual: where adding to an existing path addresses subtrees, strip_prefix refers to an entirely different subtree of the filesystem, where this crate's goal is to prevent confusion between filesystem subtrees.

from crates.

P-E-Meunier avatar P-E-Meunier commented on June 12, 2024

In Pijul, we need paths relative to the root of a repository: specifically, when we have a repository in /path/to/my/repo, the current directory is /path/to/my/repo/a/b/c, and we want to add ../d/../f, we need to know that the file to add, relative to the root of the repository, is a/f.

Now, this wasn't a problem on Unix, since the root of the repository is always in canonical form, so I was canonicalizing paths, and then stripping off the root of the repository.

Unfortunately, that doesn't really work on Windows, where canonicalize returns an "extended syntax path", which is almost never used by end users directly, and almost always as a result of calling canonicalize.

I understand that this is a strange use case, since we're essentially implementing a filesystem inside another filesystem, and we can totally do without strip_prefix if you don't think this is relevant (some documentation about that design choice would be useful though).

from crates.

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.