pistacheio / pistache

A high-performance REST toolkit written in C++
https://pistacheio.github.io/pistache/
Apache License 2.0
3.12k stars 688 forks source link

build should not silently override git hooks configuration #1126

Open jacmet opened 1 year ago

jacmet commented 1 year ago

meson.build has the following logic:

if not meson.is_subproject()
    git = find_program('git', required: false)
    if git.found()
        run_command(git, 'config', '--local', 'core.hooksPath', meson.source_root()/'.hooks', check: false)
    endif
endif

Which isn't great when building pistache not from a git clone but inside another git checkout as it will silently override the git hooks configuration of the parent checkout. An example of this is source based distribution build systems like Buildroot (http://buildroot.org) which has a pistache package.

Maybe check for a .git directory or explicitly pass --git-dir=.git to ensure that only the local git checkout is modified?

Tachi107 commented 1 year ago

Hi @jacmet, thanks for the report. Yeah checking for a .git directory could be doable. Patches welcome!