Skip to content
Snippets Groups Projects
Commit 5a5d780e authored by Patrick Baudin's avatar Patrick Baudin
Browse files

[Tools] pre-commit hook: prints the unstaged file list.

parent 28b98db6
No related branches found
No related tags found
No related merge requests found
...@@ -28,8 +28,16 @@ ...@@ -28,8 +28,16 @@
# Note: # Note:
# - that checks the unstaged version of the files and these files are # - that checks the unstaged version of the files and these files are
# only commited with a `git commit -a` command. # only commited with a `git commit -a` command.
# - so, a `git commit` command may checks the wrong version of a file. # - so, a `git commit` command may checks the wrong version of a file.
echo "Pre-commit Hook looking at staged and unstaged file version..." echo "Pre-commit Hook..."
## looks at unstaged and staged files
# Extract the files that have an unstaged version
UNSTAGED="git diff --name-status"
if [ "$(${UNSTAGED} | wc -l)" != "0" ]; then
echo "WARNING: These files will only be verified for a 'git commit -a' command."
${UNSTAGED}
fi
# Verifies the current version of files
make lint.before-commit-a make lint.before-commit-a
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