Graceful failover for when directory is not a git repository?
Andersama opened this issue · 1 comments
When building using cmake, if the cmake script fails I've run into into a situation where the failure of the cmake build makes the build significantly longer because the compiler errors accumulating from the failed build takes longer to process.
My suggestion would be to have a variation where the script always succeeds, but writes into an additional auxiliary function whether the related git functionality is truly available?
IE:
inline static bool is_git_repository();
I believe this is already covered. From a build system perspective the behavior is controlled by GIT_FAIL_IF_NONZERO_EXIT
which defaults to TRUE
(i.e. every git command must exit with zero). Turning that option OFF
allows the build to continue with missing/failed git commands.
On the C side of the house, the method git_IsPopulated()
looks like an alias for your proposed is_git_repository()
.