Move git push hook install script (#5643)
author오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Mon, 15 Jul 2019 10:46:22 +0000 (19:46 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Mon, 15 Jul 2019 10:46:22 +0000 (19:46 +0900)
- Make git hook install to command
- Move hook script to infra/nnfw/git-hooks
- Change hook script name: .sh file extension
- Update format checker: remove exceptional check policy for hook script

Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
infra/nnfw/git-hooks/pre-push.sh [moved from scripts/git-hooks/pre-push with 100% similarity]
scripts/command/format-check
scripts/command/install-githooks [moved from scripts/git-hooks/install_hooks.sh with 52% similarity, mode: 0644]

index 8224870..7bb70bb 100644 (file)
@@ -49,7 +49,7 @@ check_newline() {
 check_permission() {
     # Check all files except script
     FILES_TO_CHECK=()
-    for NON_SCRIPT_FILE in $(git ls-files -- . ':!:nnfw' ':!:run' ':!:scripts/git-hooks/*' ':!:*.sh' ':!:*.py'); do
+    for NON_SCRIPT_FILE in $(git ls-files -- . ':!:nnfw' ':!:run' ':!:*.sh' ':!:*.py'); do
         FILES_TO_CHECK+=("${NON_SCRIPT_FILE}")
     done
 
old mode 100755 (executable)
new mode 100644 (file)
similarity index 52%
rename from scripts/git-hooks/install_hooks.sh
rename to scripts/command/install-githooks
index 9ab7342..66c8535
@@ -1,11 +1,11 @@
 #!/usr/bin/env bash
 
 REPO_PATH=$(git rev-parse --show-toplevel)
-REPO_HOOKS_PATH=scripts/git-hooks
+REPO_HOOKS_PATH=infra/nnfw/git-hooks
 GIT_HOOKS_PATH=$REPO_PATH/.git/hooks
-REPO_PATH_REL=../.. # Relative path from REPO_HOOKS_PATH
+REPO_PATH_REL=../../../ # Relative path from REPO_HOOKS_PATH
 
 # Create symbolic links to hooks dir
 
 # NOTE `ln -s` does not overwrite if the file exists.
-ln -s $REPO_PATH_REL/$REPO_HOOKS_PATH/pre-push $GIT_HOOKS_PATH/pre-push
+ln -s $REPO_PATH_REL/$REPO_HOOKS_PATH/pre-push.sh $GIT_HOOKS_PATH/pre-push