#!/usr/bin/env bash
-# Copyright (c) 2015, David Martin
-# All rights reserved.
-#
+# Copyright (c) 2015, David Martin. All rights reserved.
+# Copyright (c) 2017-2022. The SimGrid team. All rights reserved.
+#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
-#
+#
# * Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
-#
+#
# * Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
-#
+#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-# git pre-commit hook that runs an clang-format stylecheck.
+# git pre-commit hook that runs a clang-format stylecheck.
# Features:
# - abort commit when commit does not comply with the style guidelines
# - create a patch of the proposed style changes
-# modifications for clang-format by rene.milk@wwu.de
+# Modifications for clang-format by rene.milk@wwu.de
# This file is part of a set of unofficial pre-commit hooks available
# at github.
# Link: https://github.com/githubbrowser/Pre-commit-hooks
-# Contact: David Martin, david.martin.mailbox@googlemail.com
+
+# Modifications for modern clang formats and other improvements as part of the SimGrid project.
+# See git logs for the detail of changes.
##################################################################
# Settings
##################################################################
# Potential names for clang-format (debian...)
-CLANG_FMT_PNAMES=(clang-format clang-format-3.8 clang-format-3.9 clang-format-4.0 clang-format-5.0)
+CLANG_FMT_PNAMES=(clang-format clang-format-5.0 clang-format-4.0 clang-format-3.9 clang-format-3.8)
CLANG_FMT_CMD="NOT-FOUND"
GIT_CLANG_FMT_CMD="NOT-FOUND"
printf "and the clang-format rules:\n\n"
cat "${patch}"
-printf "\nYou can apply these changes and readd the files with:\n"
+printf "\nYou can apply these changes and read the files with:\n"
printf " git apply ${patch} && git apply --cached ${patch}\n"
printf "(call this command from the root directory of your repository)\n"
printf "\n\n\n"