From: Jim Hill Date: Sun, 21 Dec 2014 19:26:00 GMT Subject: [PATCH v2] pre-push.sample: remove unwanted `IFS=' '`. Message-ID: <1419189960-21264-1-git-send-email-gjthill@gmail.com> In-Reply-To: <1419185665-19988-1-git-send-email-gjthill@gmail.com> Limiting the shell's word splitting breaks command substitution from e.g. `git rev-list` output, the motivating example is range="$local_sha $( git for-each-ref --format='^%(refname)' refs/remotes/$remote )" # ... commit=`git rev-list -n 1 --grep '\bbad string\b' $range` which fails with IFS=' ' because newlines aren't valid in commit id's Signed-off-by: Jim Hill --- templates/hooks--pre-push.sample | 1 - 1 file changed, 1 deletion(-) diff --git a/templates/hooks--pre-push.sample b/templates/hooks--pre-push.sample index 69e3c67..6187dbf 100755 --- a/templates/hooks--pre-push.sample +++ b/templates/hooks--pre-push.sample @@ -24,7 +24,6 @@ url="$2" z40=0000000000000000000000000000000000000000 -IFS=' ' while read local_ref local_sha remote_ref remote_sha do if [ "$local_sha" = $z40 ] -- 2.2.1.212.g51be871