[PATCH] pre-push.sample: Remove unwanted `IFS=' '`.

Subsystems: the rest

DORMANTno replies

3 messages, 1 author, 2016-06-15 · open the first message on its own page

[PATCH] pre-push.sample: Remove unwanted `IFS=' '`.

From: Jim Hill <hidden>
Date: 2016-06-15 23:03:19

---
 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

[PATCH w/signoff] pre-push.sample: Remove unwanted `IFS=' '`.

From: Jim Hill <hidden>
Date: 2016-06-15 23:03:19

Signed-off-by: Jim Hill <redacted>
---
 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

[PATCH v2] pre-push.sample: remove unwanted `IFS=' '`.

From: Jim Hill <hidden>
Date: 2016-06-15 23:03:19

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 <redacted>
---
 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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help