Skip to content

Commit

Permalink
Check for a .gitattributes file in the source dir
Browse files Browse the repository at this point in the history
Be proactive about making sure a .gitattributes file doesn't introduce
problems into the source tree.  Use the error message to direct devs to
the discussion file with more details.
  • Loading branch information
starseeker committed Mar 22, 2021
1 parent 6643cf1 commit ba45fa6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,15 @@ set(BRLCAD_CMAKE_DIR "${BRLCAD_SOURCE_DIR}/misc/CMake")
list(APPEND CMAKE_MODULE_PATH "${BRLCAD_CMAKE_DIR}")


#---------------------------------------------------------------------
# We definitely do not want a .gitattributes files present, as it is
# a potential source of subtle problems. Bail with an explanation if
# it is found to be present.
if (EXISTS "${BRLCAD_SOURCE_DIR}/.gitattributes")
message(FATAL_ERROR "\nBRL-CAD does not use a .gitattributes file in its repository. This is intended to prevent subtle errors from creeping in due to inadvertant pattern matches. See ${BRLCAD_SOURCE_DIR}/doc/git/mime_types.txt for an in-depth discussion of the recommended alternatives to use for the problems .gitattributes is intended to address.\n")
endif (EXISTS "${BRLCAD_SOURCE_DIR}/.gitattributes")


#---------------------------------------------------------------------
# Setup and checks related to system environment settings. Some of
# these impact search results needed to set default options, so we
Expand Down

0 comments on commit ba45fa6

Please sign in to comment.