git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 8/9 v12] difftool: teach difftool to handle directory diffs

From
Tim Henigan <tim.henigan@gmail.com>
Date
Apr 12, 2012, 19:10 UTC
Message-ID
<CAFouetg6Ot8sKiNi45A0QRv6YYdL3Mwrb3tkVkajQQuZukSp3g@mail.gmail.com>
In-Reply-To
<7viph46c1t.fsf@alter.siamese.dyndns.org>
On Thu, Apr 12, 2012 at 2:27 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 12 quoted lines
> Tim Henigan <tim.henigan@gmail.com> writes:
>
>> +sub setup_dir_diff
>> +{
>> +     # Run the diff; exit immediately if no diff found
>> +     my $cmd = "git diff --raw --no-abbrev -z " . join(" ", @ARGV);
>> +     my $diffrtn = `$cmd` or die $!;
>
> Why this change?  It looks like a rather unpleasant regression compared to
> the previous one that used "command_oneline", so that each element of
> @ARGV was given as a single argument to the command.  Now, you are
> splitting any argument that has $IFS in it.

The 'Git->repository->command*' functions all override the $GIT_WORK_TREE set by the user on the command line with 'pwd'. They also override the 'core.worktree' setting, if it is used.

So without this change, the following fails:
  $ GIT_DIR=<dir> GIT_WORK_TREE=<dir> git difftool -d
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";
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 6 in “difftool: teach difftool to handle directory diffs”
  1. 8/9 difftool: teach difftool to handle directory diffsTim Henigan, Apr 12, 2012
  2. Junio C HamanoApr 12, 2012
  3. Tim HeniganApr 12, 2012
  4. Junio C HamanoApr 12, 2012
  5. David AguilarApr 13, 2012
  6. Tim HeniganApr 13, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.