git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Anders Kaseorg <andersk@MIT.EDU>
Subject: Re: What's cooking in git.git (Oct 2013, #02; Mon, 14)
Date: Tue, 15 Oct 2013 12:16:56 -0700	[thread overview]
Message-ID: <20131015191656.GD9464@google.com> (raw)
In-Reply-To: <xmqqiowye66r.fsf@gitster.dls.corp.google.com>

Junio C Hamano wrote:

> I'll try:
>
>  - slurping your integration branches,
>  - teasing the topics apart out of your 'pu',
>  - populating my rerere database to match your confict resolution,
>  - reconstructing the Meta/Reintegrate insn for 'pu', and
>  - rebuilding 'pu' to make sure the end result matches yours
>
> and then push the result out to the usual places

Sounds good.  The teased-apart topics can also be found at

    https://github.com/jrn/git

[...]
>>  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.
>
> When scripts give 'echo' and '$path' (two args), does this change
> allow the 'echo' command to see the value of $path (coming from
> $sm_path), or just the not-useful-because-not-exported variable name
> '$path'?

The latter.  A quick search (web search + codesearch.debian.net)
reveals that most callers to submodule foreach either pass a script as
a single quoted argument (e.g.,
http://stackoverflow.com/questions/8364738/bash-git-submodule-foreach:

	git submodule foreach '[ "$path" = "Libraries/JSONKit" ] \
	  && branch=experimental \
	  || branch=master; git co $branch'

or http://sources.debian.net/src/jquery/1.7.2+dfsg-3/Makefile?hl=131#L131:

	git submodule foreach "git pull \$(git config remote.origin.url)"

) or pass a one-off command with no arguments intended for the shell
(e.g., http://sources.debian.net/src/libreoffice/1:4.1.1-1/g?hl=352#L352,
http://sources.debian.net/src/swi-prolog/6.4.1-3/scripts/newversion?hl=81#L81):

	git submodule foreach git push "$@"
	git submodule foreach git tag -s -f -F $tmp  $gittag

So I suspect this will fix more scripts than it breaks, though it may
still break some. :/

It might make sense to warn when passed multiple arguments and some
include shell metacharacters, since that's probably rare, too, except
it's punishing people who use multiple arguments as a way to avoid
quoting issues.  Probably there's no replacement for just advertising
the change loudly and seeking out scripts it could break.

Thanks,
Jonathan

  reply	other threads:[~2013-10-15 19:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-14 18:45 What's cooking in git.git (Oct 2013, #01; Mon, 14) Jonathan Nieder
2013-10-15  0:12 ` What's cooking in git.git (Oct 2013, #02; " Jonathan Nieder
2013-10-15  5:05   ` Ramkumar Ramachandra
2013-10-15 18:32   ` Junio C Hamano
2013-10-15 19:16     ` Jonathan Nieder [this message]
2013-10-15 19:42       ` Jens Lehmann
2013-10-15 20:05         ` Jonathan Nieder
2013-10-16 17:53           ` Jens Lehmann
2013-10-15 19:45   ` Jens Lehmann

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=20131015191656.GD9464@google.com \
    --to=jrnieder@gmail.com \
    --cc=andersk@MIT.EDU \
    --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).