<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/git-submodule.sh, branch v1.9.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://www.git.shady.money/git/atom?h=v1.9.2</id>
<link rel='self' href='https://www.git.shady.money/git/atom?h=v1.9.2'/>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/'/>
<updated>2014-01-17T20:21:20Z</updated>
<entry>
<title>Merge branch 'fp/submodule-checkout-mode'</title>
<updated>2014-01-17T20:21:20Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-01-17T20:21:20Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=1aeb10a14d5ecf5a10a4536b873c9feb244a7848'/>
<id>urn:sha1:1aeb10a14d5ecf5a10a4536b873c9feb244a7848</id>
<content type='text'>
"submodule.*.update=checkout", when propagated from .gitmodules to
.git/config, turned into a "submodule.*.update=none", which did not
make much sense.

* fp/submodule-checkout-mode:
  git-submodule.sh: 'checkout' is a valid update mode
</content>
</entry>
<entry>
<title>git-submodule.sh: 'checkout' is a valid update mode</title>
<updated>2014-01-07T17:20:59Z</updated>
<author>
<name>Francesco Pretto</name>
<email>ceztko@gmail.com</email>
</author>
<published>2014-01-05T02:50:48Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=efa8fd7ee8eb36df55b3549f6009f000347a796d'/>
<id>urn:sha1:efa8fd7ee8eb36df55b3549f6009f000347a796d</id>
<content type='text'>
'checkout' is documented as one of the valid values for the
'submodule.&lt;name&gt;.update' variable, and in a repository with the
variable set to 'checkout', "git submodule update" command does
update using the 'checkout' mode.

However, it has been an accident that the implementation works this
way; any unknown value would trigger the same codepath and update
using the 'checkout' mode.

Explicitly list 'checkout' as one of the known update modes, and
error out when an unknown update mode is used.

Teach the codepath that initializes the configuration variable from
an in-tree .gitmodules that 'checkout' is one of the valid values.
The code since ac1fbbda (submodule: do not copy unknown update mode
from .gitmodules, 2013-12-02) used to treat the value 'checkout' as
unknown and mapped it to 'none', which made little sense.  With this
change, 'checkout' specified in .gitmodules will stay to be 'checkout'.

Signed-off-by: Francesco Pretto &lt;ceztko@gmail.com&gt;
Signed-off-by: Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jl/submodule-update-retire-orig-flags'</title>
<updated>2013-12-05T21:00:20Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-12-05T21:00:20Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=c83386d14ded4968c93098d9413425ab29eb38a0'/>
<id>urn:sha1:c83386d14ded4968c93098d9413425ab29eb38a0</id>
<content type='text'>
Code clean-up.

* jl/submodule-update-retire-orig-flags:
  submodule update: remove unnecessary orig_flags variable
</content>
</entry>
<entry>
<title>Merge branch 'jk/replace-perl-in-built-scripts'</title>
<updated>2013-12-05T20:58:21Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-12-05T20:58:21Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=219ea0e79d1e5cdb5f1133aff70fe4e5737dd59d'/>
<id>urn:sha1:219ea0e79d1e5cdb5f1133aff70fe4e5737dd59d</id>
<content type='text'>
* jk/replace-perl-in-built-scripts:
  use @@PERL@@ in built scripts
</content>
</entry>
<entry>
<title>Merge branch 'ak/submodule-foreach-quoting'</title>
<updated>2013-12-05T20:53:17Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-12-05T20:53:17Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=b2a0afd96a40d6cdbba96ac9735a7b489d8d563e'/>
<id>urn:sha1:b2a0afd96a40d6cdbba96ac9735a7b489d8d563e</id>
<content type='text'>
A behavior change, but a worthwhile one: "git submodule foreach"
was treating its arguments as part of a single command to be
concatenated and passed to a shell, making writing buggy
scripts too easy.

This patch preserves the old "just pass it to the shell" behavior
when a single argument is passed to 'git submodule foreach' and
moves to a new "skip the shell and use the arguments passed
unmolested" behavior when more than one argument is passed.

The old behavior (always concatenating and passing to the shell)
was similar to the 'ssh' command, while the new behavior (switching
on the number of arguments) is what 'xterm -e' does.

May need more thought to make sure this change is advertised well
so that scripts that used multiple arguments but added their own
extra layer of quoting are not broken.

* ak/submodule-foreach-quoting:
  submodule foreach: skip eval for more than one argument
</content>
</entry>
<entry>
<title>Sync with 1.8.4.5</title>
<updated>2013-12-02T23:34:44Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-12-02T23:34:44Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=be38bee862d628e29043b3f680580ceb24a6ba1e'/>
<id>urn:sha1:be38bee862d628e29043b3f680580ceb24a6ba1e</id>
<content type='text'>
</content>
</entry>
<entry>
<title>submodule: do not copy unknown update mode from .gitmodules</title>
<updated>2013-12-02T21:48:06Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-12-02T21:31:55Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=ac1fbbda2013416b6c6a93d65c5dcf6662a60579'/>
<id>urn:sha1:ac1fbbda2013416b6c6a93d65c5dcf6662a60579</id>
<content type='text'>
When submodule.$name.update is given as hint from the upstream in
the .gitmodules file, we used to blindly copy it to .git/config,
unless there already is a value defined for the submodule.

However, there is no reason to expect that the update mode hinted by
the upstream is available in the version of Git the user is using,
and a really custom "!cmd" prepared by an upstream person running on
Linux may not even be available to a user on Windows.  It is simply
irresponsible to copy the setting blindly and to attempt to use it
during a later "submodule update" without validating it first.

Just show the suggested value to the diagnostic output, and set the
value to 'none' in the configuration, if it is not one of the ones
that are known to be supported by this version of Git.

Helped-by: Jens Lehmann &lt;Jens.Lehmann@web.de&gt;
Helped-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>submodule update: remove unnecessary orig_flags variable</title>
<updated>2013-11-11T22:10:57Z</updated>
<author>
<name>Jens Lehmann</name>
<email>Jens.Lehmann@web.de</email>
</author>
<published>2013-11-11T20:55:52Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=361412828ab580e145c3350cf075b283ebe331a5'/>
<id>urn:sha1:361412828ab580e145c3350cf075b283ebe331a5</id>
<content type='text'>
cmd_update() in the submodule script tries to preserve the options given
on the command line in the "orig_flags" variable to pass them on into the
recursion when the '--recursive' option is given. But this isn't necessary
because all the variables set by the options will be seen in the recursion
too as that is achieved by executing "eval cmd_update".

The same has already been done for cmd_status() in e15bec0ec, so let's
clean up cmd_update() likewise. Also add a test to make sure that a
submodule name given on the command line is not passed into the recursion
(which was the goal of adding the orig_flags variable in 98dbe63db).

Signed-off-by: Jens Lehmann &lt;Jens.Lehmann@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>use @@PERL@@ in built scripts</title>
<updated>2013-10-29T19:41:17Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2013-10-29T01:19:59Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=fcb06a8d54e29d12bb8160b978ce78331c95a1bf'/>
<id>urn:sha1:fcb06a8d54e29d12bb8160b978ce78331c95a1bf</id>
<content type='text'>
Several of the built shell commands invoke a bare "perl" to
perform some one-liners. This will use the first perl in the
PATH rather than the one specified by the user's SHELL_PATH.
We are not asking these perl invocations to do anything
exotic, so typically any old system perl will do; however,
in some cases the system perl may have unexpected behavior
(e.g., by handling line endings differently). We should err
on the side of using the perl the user pointed us to.

The downside of this is that on systems with a sane perl
setup, we no longer find the perl at runtime, but instead
point to a static perl (like /usr/bin/perl). That means we
will not handle somebody moving perl without rebuilding git,
whereas before we tracked it just fine. This is probably not
a big deal, though, as the built perl scripts already
suffered from this.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>submodule foreach: skip eval for more than one argument</title>
<updated>2013-09-27T23:06:44Z</updated>
<author>
<name>Anders Kaseorg</name>
<email>andersk@MIT.EDU</email>
</author>
<published>2013-09-27T10:23:55Z</published>
<link rel='alternate' type='text/html' href='https://www.git.shady.money/git/commit/?id=1c4fb136dbad762c9c4350ee79c3474ae8037587'/>
<id>urn:sha1:1c4fb136dbad762c9c4350ee79c3474ae8037587</id>
<content type='text'>
'eval "$@"' creates an extra layer of shell interpretation, which is
probably not expected by a user who passes multiple arguments to git
submodule foreach:

 $ git grep "'"
 [searches for single quotes]
 $ git submodule foreach git grep "'"
 Entering '[submodule]'
 /usr/lib/git-core/git-submodule: 1: eval: Syntax error: Unterminated quoted string
 Stopping at '[submodule]'; script returned non-zero status.

To fix this, if the user passes more than one argument, execute "$@"
directly instead of passing it to eval.

Examples:

 * Typical usage when adding an extra level of quoting is to pass a
   single argument representing the entire command to be passed to the
   shell.  This doesn't change that.

 * One can imagine someone feeding untrusted input as an argument:

 	git submodule foreach git grep "$variable"

   That currently results in a nonobvious shell code injection
   vulnerability.  Executing the command named by the arguments
   directly, as in this patch, fixes it.

Signed-off-by: Anders Kaseorg &lt;andersk@mit.edu&gt;
Acked-by: Johan Herland &lt;johan@herland.net&gt;
Signed-off-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
</content>
</entry>
</feed>
