All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Aguilar <davvid@gmail.com>
To: Tim Henigan <tim.henigan@gmail.com>
Cc: git@vger.kernel.org, ramsay@ramsay1.demon.co.uk,
	Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH 8/9 v12] difftool: teach difftool to handle directory diffs
Date: Thu, 12 Apr 2012 19:53:27 -0700	[thread overview]
Message-ID: <CAJDDKr4UbN3izmqa89CCH7OY4c9LOH0S2EbdUCxHK3G6GHd4xQ@mail.gmail.com> (raw)
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:
> 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

  reply	other threads:[~2012-04-13  2:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-12 13:18 Tim Henigan
2012-04-12 18:27 ` Junio C Hamano
2012-04-12 19:10   ` Tim Henigan
2012-04-12 19:31     ` Junio C Hamano
2012-04-13  2:53       ` David Aguilar [this message]
2012-04-13 16:31         ` Tim Henigan

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=CAJDDKr4UbN3izmqa89CCH7OY4c9LOH0S2EbdUCxHK3G6GHd4xQ@mail.gmail.com \
    --to=davvid@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=ramsay@ramsay1.demon.co.uk \
    --cc=tim.henigan@gmail.com \
    --subject='Re: [PATCH 8/9 v12] difftool: teach difftool to handle directory diffs' \
    /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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.