From: David Kastrup <dak@gnu.org>
To: Jeff King <peff@peff.net>
Cc: Junio C Hamano <gitster@pobox.com>,
Michael Haggerty <mhagger@alum.mit.edu>,
git discussion list <git@vger.kernel.org>,
Fabian <bafain@gmail.com>,
Quint Guvernator <quintus.public@gmail.com>
Subject: Re: New GSoC microproject ideas
Date: Wed, 12 Mar 2014 22:12:47 +0100 [thread overview]
Message-ID: <87k3bzi0j4.fsf@fencepost.gnu.org> (raw)
In-Reply-To: <20140312204453.GA9702@sigill.intra.peff.net> (Jeff King's message of "Wed, 12 Mar 2014 16:44:53 -0400")
Jeff King <peff@peff.net> writes:
> On Wed, Mar 12, 2014 at 09:37:41PM +0100, David Kastrup wrote:
>
>> > Try:
>> >
>> > zippo() {
>> > echo $XXX
>> > }
>> > XXX=8 zippo
>> > zippo
>> >
>> > XXX remains set after the first call under dash (but not bash). I
>> > believe "ash" has the same behavior.
>>
>> Yes. I would lean towards considering this a bug. But I agree that it
>> does not help.
>
> Dash's behavior is POSIX (and "bash --posix" behaves the same way).
>
> http://article.gmane.org/gmane.comp.version-control.git/137095
In that case I consider it a standard-compliant bug (namely being a
serious problem regarding the usefulness of shell functions). Which
makes it unlikely to go away. It makes it easier to interpret, say
zippo() {
XXX=$XXX
}
XXX=8 zippo
echo $XXX
as shell functions presumably should be able to assign to shell
variables like built-ins do. But that's not really much of an
advantage.
The behavior does not make sense to me also with regard to special
built-ins. Bash does
dak@lola:/usr/local/tmp/git$ XXX=8 :
dak@lola:/usr/local/tmp/git$ echo $XXX
dak@lola:/usr/local/tmp/git$
And that makes sense to me. Whatever, does not help.
--
David Kastrup
next prev parent reply other threads:[~2014-03-12 21:12 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-12 11:48 New GSoC microproject ideas Michael Haggerty
2014-03-12 19:04 ` Junio C Hamano
2014-03-12 19:16 ` David Kastrup
2014-03-12 19:21 ` Jeff King
2014-03-12 20:37 ` David Kastrup
2014-03-12 20:44 ` Jeff King
2014-03-12 21:12 ` David Kastrup [this message]
2014-03-13 17:06 ` Michael Haggerty
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=87k3bzi0j4.fsf@fencepost.gnu.org \
--to=dak@gnu.org \
--cc=bafain@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=mhagger@alum.mit.edu \
--cc=peff@peff.net \
--cc=quintus.public@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.