andsens / homeshick

git dotfiles synchronizer written in bash
MIT License
2.07k stars 147 forks source link

Relative symlinks do not allow git templatedir to live in castle #201

Closed johnmaguire closed 3 years ago

johnmaguire commented 3 years ago

Consider the following .gitconfig:

[init]
    templatedir = /home/jmaguire/.git_template

Here's the template directory:

jmaguire@Hermes [03:22:42 PM] [~/.git_template]
-> % tree
.
└── hooks
    ├── ctags -> ../../.homesick/repos/git-castle/home/.git_template/hooks/ctags
    ├── post-checkout -> ../../.homesick/repos/git-castle/home/.git_template/hooks/post-checkout
    ├── post-commit -> ../../.homesick/repos/git-castle/home/.git_template/hooks/post-commit
    ├── post-merge -> ../../.homesick/repos/git-castle/home/.git_template/hooks/post-merge
    └── post-rewrite -> ../../.homesick/repos/git-castle/home/.git_template/hooks/post-rewrite

1 directory, 5 files

Git will copy these files into the .git directory of a new repository - the relative symlinks do not make sense in that location.

andsens commented 3 years ago

hm, in that case I'd recommend keeping the homeshick linking out of it completely. Just do:

[init]
    templatedir = /home/jmaguire/.homesick/repos/git-castle/git_template

And place the files there.

johnmaguire commented 3 years ago

@andsens Thanks - my knee-jerk reaction was "but my home directory varies by machine!" Git is happy to take ~ though. Cheers!

johnmaguire commented 3 years ago

By the way I've been using homeshick for years and it's been solid. Thanks for the software!