path: root/templates
diff options
authorJim Hill <>2014-12-21 19:26:00 (GMT)
committerJunio C Hamano <>2014-12-22 18:27:42 (GMT)
commit3af74cfb153e20277a1d22414f04249d90d34d5c (patch)
tree29f7e45df9efd4b32bdda2c1ba0a28d6103d2787 /templates
parentbef111d0a5e4b5dcac07f92b0fc918bb31184066 (diff)
pre-push.sample: remove unnecessary and misleading IFS=' '
The sample hook explicitly sets IFS to SP and nothing else so that the "read" used in the per-ref while loop that iterates over "<localref> SP <localsha1> SP <remoteref> SP <remotesha>" records, where we know refs and sha1s will not have SPs, would split them correctly. While this is not wrong per-se, it is not necessary; because we know these fields do not contain HT or LF, either, we can simply leave IFS the default. This will also prevent those who cut and paste from this sample from getting bitten when they write things in the per-ref loop that need splitting with the default $IFS (e.g. use $(git rev-list ...) to produce one-record-per-line output). Signed-off-by: Jim Hill <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'templates')
1 files changed, 0 insertions, 1 deletions
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"
-IFS=' '
while read local_ref local_sha remote_ref remote_sha
if [ "$local_sha" = $z40 ]