From cb05bc6577184b0a36973d0d7a907fa55d645361 Mon Sep 17 00:00:00 2001 From: Patrick Baudin <patrick.baudin@cea.fr> Date: Thu, 2 Jun 2022 11:57:47 +0200 Subject: [PATCH] fixes /devel_tools/git-hooks/pre-commit header --- .gitattributes | 3 +++ devel_tools/git-hooks/pre-commit | 22 +++++++++++++++++++++- headers/headache_config.txt | 6 ++++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index 1216d0b978e..0d4cce2f50b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -42,7 +42,10 @@ Make* header_spec=CEA_LGPL /bin/frama-c* header_spec=CEA_LGPL +/devel_tools/git-hooks/pre-commit header_spec=CEA_LGPL + /headers/headache_config.txt header_spec=CEA_LGPL + /share/autocomplete_frama-c header_spec=CEA_LGPL /share/emacs/frama-c-*.el header_spec=CEA_LGPL /share/_frama-c header_spec=CEA_LGPL diff --git a/devel_tools/git-hooks/pre-commit b/devel_tools/git-hooks/pre-commit index fec935b5fc0..36353a8d1a7 100755 --- a/devel_tools/git-hooks/pre-commit +++ b/devel_tools/git-hooks/pre-commit @@ -1,6 +1,26 @@ #!/bin/bash - # -*- mode: bash +########################################################################## +# # +# This file is part of Frama-C. # +# # +# Copyright (C) 2007-2022 # +# CEA (Commissariat à l'énergie atomique et aux énergies # +# alternatives) # +# # +# you can redistribute it and/or modify it under the terms of the GNU # +# Lesser General Public License as published by the Free Software # +# Foundation, version 2.1. # +# # +# It is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU Lesser General Public License for more details. # +# # +# See the GNU Lesser General Public License version 2.1 # +# for more details (enclosed in the file licenses/LGPLv2.1). # +# # +########################################################################## if git rev-parse --verify HEAD >/dev/null 2>&1 then diff --git a/headers/headache_config.txt b/headers/headache_config.txt index 3f188ea4f7a..b49598cd666 100644 --- a/headers/headache_config.txt +++ b/headers/headache_config.txt @@ -87,6 +87,12 @@ | "frama-c.debug" -> frame open:"#" line:"#" close:"#" | ".*frama-c.debug" -> skip match:"#!.*" +############# +# Git hooks # +############# +| "pre-commit" -> frame open:"#" line:"#" close:"#" +| ".*pre-commit" -> skip multiline_match: "#!.*" multiline_match: "# -\*-.*" + ############### # Zsh scripts # ############### -- GitLab