Re: [PATCH 8/9 v12] difftool: teach difftool to handle directory diffs
- From
David Aguilar <davvid@gmail.com>
- Date
- Apr 13, 2012, 02:53 UTC
- Message-ID
- <CAJDDKr4UbN3izmqa89CCH7OY4c9LOH0S2EbdUCxHK3G6GHd4xQ@mail.gmail.com>
- In-Reply-To
- <7v62d4692l.fsf@alter.siamese.dyndns.org>
On Thu, Apr 12, 2012 at 12:31 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 8 quoted lines
> Tim Henigan <tim.henigan@gmail.com> writes:
>
>> Would the following change be better?
>>
>> - my $cmd = "git diff --raw --no-abbrev -z " . join(" ", @ARGV);
>> + my $cmd = "git diff --raw --no-abbrev -z @ARGV";
>
> They look exactly the same to me.The issue is that this does not properly handle shell characters, IFS, etc.
I think a simple solution would be to use git diff --exit-code --quiet here.
e.g.
my $rc = system('git', 'diff', '--exit-code', '--quiet', @ARGV);That avoids the shell and properly handles shell meta-characters, IFS, etc.
-- David