From: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
To: Fredrik Gustafsson <iveqy@iveqy.com>
Cc: Jens Lehmann <Jens.Lehmann@web.de>,
Jonathan Nieder <jrnieder@gmail.com>,
"brian m. carlson" <sandals@crustytoothpaste.net>,
git@vger.kernel.org, judge.packham@gmail.com,
Jorge-Juan.Garcia-Garcia@ensimag.imag.fr, gitster@pobox.com
Subject: Re: [PATCH 1/2] submodule: fix confusing variable name
Date: Thu, 08 Aug 2013 18:44:22 +0100 [thread overview]
Message-ID: <5203D8F6.2020102@ramsay1.demon.co.uk> (raw)
In-Reply-To: <20130804212938.GL19369@paksenarrion.iveqy.com>
Fredrik Gustafsson wrote:
> On Sun, Aug 04, 2013 at 07:34:48PM +0200, Jens Lehmann wrote:
>> But we'll have to use sm_path here (like everywhere else in the
>> submodule script), because we'll run into problems under Windows
>> otherwise (see 64394e3ae9 for details). Apart from that the patch
>> is fine.
>
> We're still using path= in the foreach-script. Or rather, we're setting
> it. From what I can see and from the commit message 64394e3ae9 it could
> possible be a problem.
Please do not use a $path variable in any script intended to be run on
windows; those poor souls who would otherwise have to fix the bugs will
thank you! :-D
Actually, it's not so much the use of a $path variable, rather the act
of _exporting_ such a variable that causes the problem. (Which is why
using $path with eval_gettext[ln] is such a problem, of course.)
As noted in the above commit, $path is unfortunately a documented part
of the public API for the foreach subcommand. However, the foreach
subcommand is (mostly) fine; given the fact that the user script is
eval-ed in a context in which $path is not exported. The reason for
the 'mostly' is simply that the user could shoot himself in the foot
by export-ing $path in their script, so that something like:
$ git submodule foreach 'export path; echo $path `git rev-parse HEAD`'
will indeed fail (ie git rev-parse will not execute).
> Not sure how to solve it though... Just a simple correction would break
> all script depending on that.
$path is part of the public API, so we can't just remove it. It would
require a deprecation period, etc,. (Adding/documenting $sm_path as an
alternative *may* be worth doing. dunno.)
HTH
ATB,
Ramsay Jones
next prev parent reply other threads:[~2013-08-09 17:11 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-03 17:14 Don't print status output with submodule.<name>.ignore=all brian m. carlson
2013-08-03 17:14 ` [PATCH 1/2] submodule: fix confusing variable name brian m. carlson
2013-08-03 18:14 ` Jonathan Nieder
2013-08-04 17:34 ` Jens Lehmann
2013-08-04 21:29 ` Fredrik Gustafsson
2013-08-06 17:33 ` Jens Lehmann
2013-08-08 17:44 ` Ramsay Jones [this message]
2013-08-09 17:26 ` Fredrik Gustafsson
2013-08-09 18:53 ` Junio C Hamano
2013-08-11 19:53 ` Mark Levedahl
2013-08-03 17:14 ` [PATCH 2/2] submodule: don't print status output with ignore=all brian m. carlson
2013-08-03 18:24 ` Jonathan Nieder
2013-08-04 18:24 ` Jens Lehmann
2013-08-10 16:37 ` brian m. carlson
2013-08-11 16:03 ` brian m. carlson
2013-08-11 18:33 ` Jonathan Nieder
2013-08-17 16:27 ` brian m. carlson
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=5203D8F6.2020102@ramsay1.demon.co.uk \
--to=ramsay@ramsay1.demon.co.uk \
--cc=Jens.Lehmann@web.de \
--cc=Jorge-Juan.Garcia-Garcia@ensimag.imag.fr \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=iveqy@iveqy.com \
--cc=jrnieder@gmail.com \
--cc=judge.packham@gmail.com \
--cc=sandals@crustytoothpaste.net \
/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.