From: Marc Branchaud <marcnarc@xiplink.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: Weird problem with git-submodule.sh
Date: Fri, 07 Dec 2012 15:17:27 -0500 [thread overview]
Message-ID: <50C24ED7.90000@xiplink.com> (raw)
In-Reply-To: <7vwqwtfzis.fsf@alter.siamese.dyndns.org>
On 12-12-07 02:11 PM, Junio C Hamano wrote:
> Marc Branchaud <marcnarc@xiplink.com> writes:
>
>> On 12-12-07 12:54 PM, Junio C Hamano wrote:
>>> Marc Branchaud <marcnarc@xiplink.com> writes:
>>>
>>>> This is with git 1.8.0.1 on all the machines involved.
>>>>
>>>> One of our build machines is having trouble with "git submodule":
>>>> ...
>>>> Any ideas?
>>>
>>> How and why is the IFS set differently only on one of your build
>>> machines?
>>
>> It's not. On all machines:
>> $ set | grep IFS
>> IFS=$' \t\n'
>>
>> As I said, if I isolate the module_list() function into another script it
>> works fine, with the exact same environment that breaks in git-submodule.sh.
>>
>> Also, note that at the top of git-submodule there's
>> . git-sh-setup
>> which does
>> unset IFS
>
> Yeah, now it makes sense why you wrote "Weird" on the subject line.
> What difference, if any, does the problematic box have compared to
> your other healthy boxes? It uses a different /bin/sh?
>
> Just taking a shot in the dark...
Bisected this down to exactly that "unset IFS" line in git-sh-setup.sh, from
your commit 785063e02bb249 (whaddya trying to do to me Junio?? :) ):
Author: Junio C Hamano <gitster@pobox.com>
Date: Wed Aug 8 12:08:17 2012 -0700
sh-setup: protect from exported IFS
Many scripted Porcelains rely on being able to split words at the
default $IFS characters, i.e. SP, HT and LF. If the user exports a
non-default IFS to the environment, what they read from plumbing
commands such as ls-files that use HT to delimit fields may not be
split in the way we expect.
Protect ourselves by resetting it, just like we do so against CDPATH
exported to the environment.
Noticed by Andrew Dranse <adranse@oanda.com>.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Perhaps IFS should be set to " \t\n" (which I believe is sh's default)
instead of just unsetting it altogether? (Note that in my testing I had to
set IFS to a literal <space><tab><newline> string.)
M.
next prev parent reply other threads:[~2012-12-07 20:17 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-07 17:44 Weird problem with git-submodule.sh Marc Branchaud
2012-12-07 17:54 ` Junio C Hamano
2012-12-07 18:03 ` Marc Branchaud
2012-12-07 19:11 ` Junio C Hamano
2012-12-07 20:17 ` Marc Branchaud [this message]
2012-12-07 20:23 ` Junio C Hamano
2012-12-07 20:44 ` Marc Branchaud
2012-12-07 21:08 ` Junio C Hamano
2012-12-07 22:34 ` [PATCH] sh-setup: work around "unset IFS" bug in some shells Junio C Hamano
2012-12-07 22:37 ` Marc Branchaud
2012-12-07 22:50 ` Andreas Schwab
2012-12-07 22:58 ` Junio C Hamano
2012-12-08 9:25 ` Andreas Schwab
2012-12-09 21:05 ` Weird problem with git-submodule.sh Stefano Lattarini
2012-12-12 19:10 ` Phil Hord
2012-12-12 19:44 ` Junio C Hamano
2012-12-12 23:12 ` Phil Hord
2012-12-07 21:01 ` Marc Branchaud
2012-12-07 22:15 ` [PATCH] sh-setup: Explicitly set IFS to its default, instead of unsetting it marcnarc
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=50C24ED7.90000@xiplink.com \
--to=marcnarc@xiplink.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).