Skip to content
Snippets Groups Projects
Commit bd48373d authored by Pierre Courtieu's avatar Pierre Courtieu
Browse files

Adapting the pre-commit script (sanity-git.sh) to pactole-dev.

Reminder: to make it active, you need to do the following each time
you clone pactole-dev (assuming you do NOT already have a pre-commit
script in .git/hooks):

cp sanity-git.sh .git/hooks/pre-commit
chmod u+x .git/hooks/pre-commit
parent d9f00379
No related branches found
No related tags found
No related merge requests found
#!/bin/sh #!/bin/sh
# if launched by git commit # This script checks that pactole archive is in a correct state:
# cd dev_coq # - no coq file should be there but not cited in _CoqProject (untrackedvfiles).
# - no file cited in _CoqProject should be absent (unfoundvfiles).
#
# NOTE: we do note check that compilation succeeds. It is too long and
# should be checked by CI anyway..
# To enable this as a pre-commit check, do (assuming you do NOT
# already have a pre-commit script in .git/hooks):
#
# cp sanity-git.sh .git/hooks/pre-commit
# chmod u+x .git/hooks/pre-commit
#
# Note that you will need to do that on each local clone you have, as
# it is not versionized.
AUXFILES=".allvfiles .trackedfiles .untrackedvfiles .unfoundvfiles" AUXFILES=".allvfiles .trackedfiles .untrackedvfiles .unfoundvfiles"
...@@ -54,6 +67,7 @@ NC='\033[0m' # No Color ...@@ -54,6 +67,7 @@ NC='\033[0m' # No Color
if [ "$EXITCODE2" -eq 1 -a "$EXITCODE1" -eq 1 ]; if [ "$EXITCODE2" -eq 1 -a "$EXITCODE1" -eq 1 ];
then then
EXITCODE=0 EXITCODE=0
echo "Sanity check OK"
else else
echo "${RED}Commit was aborted for the reason described above.${NC}" echo "${RED}Commit was aborted for the reason described above.${NC}"
echo echo
...@@ -67,7 +81,4 @@ fi ...@@ -67,7 +81,4 @@ fi
rm -f $AUXFILES rm -f $AUXFILES
# if launched by git commit
# cd ..
exit $EXITCODE exit $EXITCODE
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment