Re: nd/magic-pathspec exposes breakage in git-add--interactive on Windows

2013-08-29 Thread Duy Nguyen
On Thu, Aug 29, 2013 at 1:54 PM, Johannes Sixt j.s...@viscovery.net wrote:
 With nd/magic-pathspec I get the following failure on Windows in
 t2016-checkout-patch.sh:

 expecting success:
 set_state dir/foo work head 
 # the third n is to get out in case it mistakenly does not apply
 (echo y; echo n; echo n) | (cd dir  git checkout -p foo) 
 verify_saved_state bar 
 verify_state dir/foo head head

  xx.
  1d.
  10e.
 msys does not support: :(prefix:4)dir/foo
 not ok 13 - path limiting works: foo inside dir

 The error message 'msys does not support...' originates from this function
 in git-add--interactive.perl (which is invoked from checkout -p):

   sub run_cmd_pipe {
 if ($^O eq 'MSWin32' || $^O eq 'msys') {
 my @invalid = grep {m/[:*]/} @_;
 die $^O does not support: @invalid\n if @invalid;
 my @args = map { m/ /o ? \$_\: $_ } @_;
 return qx{@args};
 } else {
 my $fh = undef;
 open($fh, '-|', @_) or die;
 return $fh;
 }
   }

 It looks like on Windows we disallow arguments that contain double-quote,
 colon, or asterisk, and otherwise wrap arguments in double-quotes if they
 contain space. Then pass them through qx{}, which I can only guess what it
 does.

 This code was introduced in 21e9757e (Hack git-add--interactive to make it
 work with ActiveState Perl, 2007-08-01). The commit message has the
 general statement It wont work for arguments with special characters
 (like , : or *)), which I do not know how to interpret: Does ActiveState
 Perl not work with special charactoers, or Windows? Because the latter is
 definitely not true.

If it indeed does not work with ActiveState Perl, we still have a
chance to make it :(prefix=4)dir/foo, assuming '=' does not fall to
the same category as ':'


 Can we be more permissive in the 'my @invalid' check without breaking
 ActiveState Perl?

 BTW, there is a similar failure in t7105-reset-patch.sh, which invokes
 'git reset -p', but I haven't investigate further.

 -- Hannes
-- 
Duy
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: nd/magic-pathspec exposes breakage in git-add--interactive on Windows

2013-08-29 Thread Alex Riesen
On Thu, Aug 29, 2013 at 8:54 AM, Johannes Sixt j.s...@viscovery.net wrote:
 It looks like on Windows we disallow arguments that contain double-quote,
 colon, or asterisk, and otherwise wrap arguments in double-quotes if they
 contain space. Then pass them through qx{}, which I can only guess what it
 does.

Well, the command interpreter of the platform implementation caused
this, I believe.
Quoting of the double quotes for it was too cumbersome for rarely used
combination
(windows, ActiveState Perl, and Git). I guess it is more popular now?
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html