From: Jim Hill <gjthill@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: [PATCH v2] pre-push.sample: remove unwanted `IFS=' '`.
Date: Sun, 21 Dec 2014 11:26:00 -0800 [thread overview]
Message-ID: <1419189960-21264-1-git-send-email-gjthill@gmail.com> (raw)
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 <gjthill@gmail.com>
---
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
prev parent reply other threads:[~2014-12-21 19:26 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-21 18:14 [PATCH] pre-push.sample: Remove unwanted `IFS=' '` Jim Hill
2014-12-21 18:25 ` [PATCH w/signoff] " Jim Hill
2014-12-21 18:50 ` Junio C Hamano
2014-12-21 19:12 ` Jim Hill
2014-12-21 22:49 ` Junio C Hamano
2014-12-23 2:08 ` Junio C Hamano
2014-12-21 19:26 ` Jim Hill [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1419189960-21264-1-git-send-email-gjthill@gmail.com \
--to=gjthill@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).