snitch-org / snitch

Lightweight C++20 testing framework.
Boost Software License 1.0
257 stars 7 forks source link

fatal: not a git repository (or any parent up to mount point /) #92

Closed tocic closed 1 year ago

tocic commented 1 year ago

When building the library using a tarball or a .zip archive there's no .git dir in the project root. And, consequently, you'll get the following message in the stderr:

fatal: not a git repository (or any parent up to mount point /)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

from this command:

https://github.com/cschreib/snitch/blob/d040b89227a4cea74986aeaf4b57ec62994cab7e/CMakeLists.txt#L33-L38

That doesn't prevent the configuration, but the red message is still annoying.

The simplest solution is to add ERROR_QUIET to the command above. That will also fix the git: not found message in case you have a git-less environment (e.g., FROM alpine in docker), but may silence other errors if any.

I'm not familiar with meson, but perhaps this should be fixed too:

https://github.com/cschreib/snitch/blob/d040b89227a4cea74986aeaf4b57ec62994cab7e/snitch/meson.build#L4

cschreib commented 1 year ago

Thanks, on it.