From: David Aguilar Date: Fri, 13 Apr 2012 02:53:27 GMT Subject: Re: [PATCH 8/9 v12] difftool: teach difftool to handle directory diffs Message-ID: In-Reply-To: <7v62d4692l.fsf@alter.siamese.dyndns.org> On Thu, Apr 12, 2012 at 12:31 PM, Junio C Hamano wrote: > Tim Henigan 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