Skip to content

Symlinking git hooks causing unexpected behaviour #627

@vimkin

Description

@vimkin

Thank you for a great repo guys, it helps me really a lot to organise all the dotfiles stuff!

There is a potential implicit issue/risk covers in symlinking hooks.

Description:

Let's say you have such scenario:

  • git clone project-a
  • git clone project-b
  • cd project-a
  • composer install // additionally installs f.e. post-commit hook

This will most probably break project-b by modifying the project hooks and additionally will modify template hooks in the root dotfiles folder.

In such a scenario composer changes post-commit hook in the project-a which following the links chain, leads to the changes in project-b/.git/hooks/post-commit as well as ~/dotfiles/git_template/hooks/post-commit, since post-commit in project-a is just a link to the initial file.

It's quite common that some tool like composer may change hooks, which leads to such implicit scenario if hooks were symlinked.

Possible solution:

git_template/hooks should be copied and not symlinked

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions