Code Monkey home page Code Monkey logo

Comments (2)

twpayne avatar twpayne commented on June 18, 2024

No. Yes, git stores executable bits, but chezmoi is designed to work with all version control systems (some of which do not presreve executable bits) and all file systems (some of which do not have executable bits). Also, such a feature would introduce ambiguity: for the target file to have the executable bit set, is it necessary for the source file to have the executable_ attribute, the executable bit set, or both?

For more info on chezmoi's design, see https://www.chezmoi.io/user-guide/frequently-asked-questions/design/#why-does-chezmoi-use-weird-filenames.

from chezmoi.

tmccombs avatar tmccombs commented on June 18, 2024

but chezmoi is designed to work with all version control systems (some of which do not presreve executable bits)

Which ones don't? From some quick research it looks like git, svn, fossil, mercurial, bzr and darcs have some facility for marking files as executable (although in some it must be done explicitly when adding the file).

To be clear I am not suggesting removing the executable_ attribute, but allowing you to also use the executable bit to signify that it is executable. So if you do use a VCS that doesn't keep track of an executable flag, you can still use that.

Support for this could even be in a configuration option that needs to be opted in to.

and all file systems (some of which do not have executable bits)

true. But if the target file system doesn't have an executable bit, then the executable_ attribute doesn't really do anything does it? And if your target file system does have an executable bit, and your source file system doesn't, you can still use the executable_ flag.

such a feature would introduce ambiguity: for the target file to have the executable bit set, is it necessary for the source file to have the executable_ attribute, the executable bit set, or both?

I would think either. That is, the target file is executable if the source file has the executable_ attribute OR it has the executable bit set and doesn't have any of the attributes indicating a script, or a template (run_, .tmpl).

In pseudocode something like:

targetIsExecutable = source.attributes.includes("executable") || (source.permissions.executable && source.isNormalFile())

from chezmoi.

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.