Skip to content

Support creating hard links (in additional to symlinks) #301

Description

@dxlr8r

With for example, gitman.yml:

location: vendor/gitman
sources:
  - repo: https://github.com/jacebrowning/gitman.git
    name: gitman
    rev: main
    type: git
    links:
      - source: doc
        target: vendor/doc/gitman

And .gitignore:

vendor/gitman

vendor/doc/gitman will be a symlink, and content in vendor/gitman will be ignored.

For my project I want to keep copies of the libraries I use, and since git does not follow symlinks the approach above does not work.

I could of course remove the entry in .gitignore, but then I get a lot of unneeded resources.

Hard links seem to be the way to resolve this. Suggested implementation, gitman.yml:

location: vendor/gitman
sources:
  - repo: https://github.com/jacebrowning/gitman.git
    name: gitman
    rev: main
    type: git
    hardlinks:
      - source: doc
        target: vendor/doc/gitman

vendor/doc/gitman would be a regular directory, each file inside would be a hardlink, and any nesting directory would be recreated with the same name as a directory (not symlink). Like a copy (cp -r) but the files are hard linked instead of copies.

Of course hard links has some limitations, has to be on same file system for instance. So an option to fallback to a copy would perhaps required.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions