CMake ExternalProject and Git filters

Git filters may clash with the CMake ExternalProject update step. The “download” step invokes checkout and the “update” step may stash and invoke the Git filters, causing the build to fail.

There is not a straightforward way to turn off CMake Git filters.

Solution: Git pre-commit hook instead of Git filters. Users with Git filters need to disable the filters in ~/.gitconfig and preferably change the filters to pre-commit hooks if possible.

Things that did not work

For reference, these did not help override Git filters.

ExternalProject_Add(...
GIT_REMOTE_UPDATE_STRATEGY  "CHECKOUT"
UPDATE_COMMAND ""
)
ExternalProject_Add_Step(MyProj gitOverride
DEPENDERS update
COMMAND git -C <SOURCE_DIR> config --local filter.strip-notebook-output.clean cat
COMMAND git -C <SOURCE_DIR> config --local --list
COMMENT "CMake ExternalProject: override git config to strip notebook output"
LOG true
INDEPENDENT true
)