Re: Weird problem with git-submodule.sh
- From
Stefano Lattarini <stefano.lattarini@gmail.com>
- Date
- Dec 9, 2012, 21:05 UTC
- Message-ID
- <50C4FD00.4010003@gmail.com>
- In-Reply-To
- <7vobi5fu3c.fsf@alter.siamese.dyndns.org>
Hi Junio, Marc.
On 12/07/2012 10:08 PM, Junio C Hamano wrote:
Show 13 quoted lines
> Marc Branchaud <marcnarc@xiplink.com> writes: > >> It's FreeBSD 7.2, which I know is an obsolete version but I'm not able to >> upgrade the machine. I believe FreeBSD's sh is, or is derived from, dash. > > Finally. Yes, as you suspected, I am perfectly fine to explicitly > set IFS to the default values. > > I wanted to have specific names to write in the commit log message, > in-code comments and possibly release notes. That way, people can > decide if the issue affects them and they should upgrade once the > fix is made. >
The Autoconf manual suggests against unsetting IFS instead of resetting it to the default sequence for yet another reason: if IFS is unset, code that tries to save and restore its value will incorrectly reset it to an empty value, thus disabling field splitting:
unset IFS
# default separators used for field splitting
# ...
saved_IFS=$IFS
IFS=:
# code using the new IFS
IFS=$saved_IFS
# no field splitting performed from now on!Not sure how this is relevant for the Git codebase, but maybe it is something worth reporting in the commit message of a proposed patch.
Regards, Stefano