From 233fb7d05090406b41c59b94326378d8532be30f Mon Sep 17 00:00:00 2001 From: "raphael.kubo.da.costa@intel.com" Date: Mon, 29 Jul 2013 12:13:36 +0000 Subject: [PATCH] The scripts are simple enough and should work fine under any POSIX shell, which is particularly helpful when one is using `gclient sync' on a platform that does not have /bin/bash (ie. it's installed in another location or not present at all), since the hooks are automatically added to the git checkouts. While here, just `exec' the scripts directly instead of invoking another shell by hand and remove the redundant `exit 0' lines. R=cmp@chromium.org,dpranke@chromium.org,szager@chromium.org Review URL: https://chromiumcodereview.appspot.com/19278004 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@214181 0039d316-1c4b-4281-b951-d872f2087c98 --- git-templates/hooks/applypatch-msg | 4 ++-- git-templates/hooks/post-applypatch | 4 ++-- git-templates/hooks/post-checkout | 4 ++-- git-templates/hooks/post-commit | 4 ++-- git-templates/hooks/post-merge | 4 ++-- git-templates/hooks/post-update | 4 ++-- git-templates/hooks/pre-applypatch | 4 ++-- git-templates/hooks/pre-auto-gc | 4 ++-- git-templates/hooks/pre-commit | 4 ++-- git-templates/hooks/pre-rebase | 4 ++-- git-templates/hooks/prepare-commit-msg | 4 ++-- 11 files changed, 22 insertions(+), 22 deletions(-) diff --git a/git-templates/hooks/applypatch-msg b/git-templates/hooks/applypatch-msg index bc62ba94b..35e558bfc 100755 --- a/git-templates/hooks/applypatch-msg +++ b/git-templates/hooks/applypatch-msg @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh -[ -e "build/git-hooks/applypatch-msg" ] && exec bash "build/git-hooks/applypatch-msg" "$@" +[ -e "build/git-hooks/applypatch-msg" ] && exec "build/git-hooks/applypatch-msg" "$@" exit 0 diff --git a/git-templates/hooks/post-applypatch b/git-templates/hooks/post-applypatch index 9f970733e..bd7fae87a 100755 --- a/git-templates/hooks/post-applypatch +++ b/git-templates/hooks/post-applypatch @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh -[ -e "build/git-hooks/post-applypatch" ] && exec bash "build/git-hooks/post-applypatch" "$@" +[ -e "build/git-hooks/post-applypatch" ] && exec "build/git-hooks/post-applypatch" "$@" exit 0 diff --git a/git-templates/hooks/post-checkout b/git-templates/hooks/post-checkout index 257943435..856d4f57c 100755 --- a/git-templates/hooks/post-checkout +++ b/git-templates/hooks/post-checkout @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh -[ -e "build/git-hooks/post-checkout" ] && exec bash "build/git-hooks/post-checkout" "$@" +[ -e "build/git-hooks/post-checkout" ] && exec "build/git-hooks/post-checkout" "$@" exit 0 diff --git a/git-templates/hooks/post-commit b/git-templates/hooks/post-commit index 6b1c6c90e..dd177313b 100755 --- a/git-templates/hooks/post-commit +++ b/git-templates/hooks/post-commit @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh -[ -e "build/git-hooks/post-commit" ] && exec bash "build/git-hooks/post-commit" "$@" +[ -e "build/git-hooks/post-commit" ] && exec "build/git-hooks/post-commit" "$@" exit 0 diff --git a/git-templates/hooks/post-merge b/git-templates/hooks/post-merge index 706530631..87ebad2ee 100755 --- a/git-templates/hooks/post-merge +++ b/git-templates/hooks/post-merge @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh -[ -e "build/git-hooks/post-merge" ] && exec bash "build/git-hooks/post-merge" "$@" +[ -e "build/git-hooks/post-merge" ] && exec "build/git-hooks/post-merge" "$@" exit 0 diff --git a/git-templates/hooks/post-update b/git-templates/hooks/post-update index b0fe1c52a..db4ceb015 100755 --- a/git-templates/hooks/post-update +++ b/git-templates/hooks/post-update @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh -[ -e "build/git-hooks/post-update" ] && exec bash "build/git-hooks/post-update" "$@" +[ -e "build/git-hooks/post-update" ] && exec "build/git-hooks/post-update" "$@" exit 0 diff --git a/git-templates/hooks/pre-applypatch b/git-templates/hooks/pre-applypatch index c37aa4add..d2a43a2b9 100755 --- a/git-templates/hooks/pre-applypatch +++ b/git-templates/hooks/pre-applypatch @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh -[ -e "build/git-hooks/pre-applypatch" ] && exec bash "build/git-hooks/pre-applypatch" "$@" +[ -e "build/git-hooks/pre-applypatch" ] && exec "build/git-hooks/pre-applypatch" "$@" exit 0 diff --git a/git-templates/hooks/pre-auto-gc b/git-templates/hooks/pre-auto-gc index 0b87a0f80..0bde94fe6 100755 --- a/git-templates/hooks/pre-auto-gc +++ b/git-templates/hooks/pre-auto-gc @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh -[ -e "build/git-hooks/pre-auto-gc" ] && exec bash "build/git-hooks/pre-auto-gc" "$@" +[ -e "build/git-hooks/pre-auto-gc" ] && exec "build/git-hooks/pre-auto-gc" "$@" exit 0 diff --git a/git-templates/hooks/pre-commit b/git-templates/hooks/pre-commit index f5ea25c81..7201ded43 100755 --- a/git-templates/hooks/pre-commit +++ b/git-templates/hooks/pre-commit @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh -[ -e "build/git-hooks/pre-commit" ] && exec bash "build/git-hooks/pre-commit" "$@" +[ -e "build/git-hooks/pre-commit" ] && exec "build/git-hooks/pre-commit" "$@" exit 0 diff --git a/git-templates/hooks/pre-rebase b/git-templates/hooks/pre-rebase index dd01fddce..20ad5bb33 100755 --- a/git-templates/hooks/pre-rebase +++ b/git-templates/hooks/pre-rebase @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh -[ -e "build/git-hooks/pre-rebase" ] && exec bash "build/git-hooks/pre-rebase" "$@" +[ -e "build/git-hooks/pre-rebase" ] && exec "build/git-hooks/pre-rebase" "$@" exit 0 diff --git a/git-templates/hooks/prepare-commit-msg b/git-templates/hooks/prepare-commit-msg index c76199663..9edd243ce 100755 --- a/git-templates/hooks/prepare-commit-msg +++ b/git-templates/hooks/prepare-commit-msg @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh -[ -e "build/git-hooks/prepare-commit-msg" ] && exec bash "build/git-hooks/prepare-commit-msg" "$@" +[ -e "build/git-hooks/prepare-commit-msg" ] && exec "build/git-hooks/prepare-commit-msg" "$@" exit 0