Skip to content

Allow to symlink only the pre-commit script in hooks #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vedelaar
Copy link

@vedelaar vedelaar commented Sep 13, 2018

and not the whole hooks directory.

ln -s ../git-hooks .git/hooks
ln -s ../git-hooks/pre-commit .git/hooks/pre-commit

#17

…le hooks directory.

ln -s ../git-hooks .git/hooks
ln -s ../git-hooks/pre-commit .git/hooks/pre-commit
Copy link
Owner

@michalrus michalrus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A very nice idea and a real problem, indeed, thanks!

@@ -3,7 +3,7 @@
root="$(git rev-parse --show-toplevel)"
[ -d "$root" ] || exit 1

owndir="$(cd "$(dirname "$0")"; pwd -P)"
owndir="$(dirname "$(readlink -f "$0")")"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

readlink -f is GNU, not POSIX, so it’ll break on macOS or other *BSD systems.

Could you do it portably?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants