Skip to content

git-hooks: resolve git symlink on Mac to find hooks#402

Merged
mjcheetham merged 1 commit intomicrosoft:mainfrom
mjcheetham:discover-git-hooks
Jul 15, 2020
Merged

git-hooks: resolve git symlink on Mac to find hooks#402
mjcheetham merged 1 commit intomicrosoft:mainfrom
mjcheetham:discover-git-hooks

Conversation

@mjcheetham
Copy link
Member

Replace the hardcoded /usr/local/git/ base installation path on macOS
with a which git and symlink resolution, to ensure we always find the
correct hooks template directory.

This works for the Homebrew installed Git, or the .pkg installed Git.
Apple-Git would work, but it does not ship with any hook templates
anyway!

Fixes #401

@mjcheetham mjcheetham requested a review from derrickstolee July 13, 2020 09:08
Copy link
Member

@dscho dscho left a comment

Choose a reason for hiding this comment

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

It is too bad that there is no way to ask Git "where are your templates, friend?"

Copy link
Member

@dscho dscho left a comment

Choose a reason for hiding this comment

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

I have no further suggestions in addition to the ones already provided by @derrickstolee and @jeffhostetler.

Replace the hardcoded /usr/local/git/ base installation path on macOS
with a `which git` and symlink resolution, to ensure we always find the
correct hooks template directory.

This works for the Homebrew installed Git, or the .pkg installed Git.
Apple-Git would work, but it does not ship with any hook templates
anyway!
@mjcheetham mjcheetham force-pushed the discover-git-hooks branch from 4332081 to ad3c8d6 Compare July 15, 2020 09:46
@mjcheetham mjcheetham merged commit 4498a05 into microsoft:main Jul 15, 2020
@mjcheetham mjcheetham deleted the discover-git-hooks branch July 15, 2020 15:34
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.

scalar clone fails when scalar and microsoft-git are installed via Homebrew

4 participants