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

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

From
David Aguilar <davvid@gmail.com>
Date
Apr 21, 2012, 23:07 UTC
Message-ID
<CAJDDKr4AuTHX2LSFuw4g2fWsE3M+A2EcX9bXx6yDRebvAMx_1g@mail.gmail.com>
In-Reply-To
<1334940988-8940-1-git-send-email-tim.henigan@gmail.com>
On Fri, Apr 20, 2012 at 9:56 AM, Tim Henigan <tim.henigan@gmail.com> wrote:
Show 31 quoted lines
> [snip]
> +
> +sub setup_dir_diff
> +{
> +       # Run the diff; exit immediately if no diff found
> +       # 'Repository' and 'WorkingCopy' must be explicitly set to insure that
> +       # if $GIT_DIR and $GIT_WORK_TREE are set in ENV, they are actually used
> +       # by Git->repository->command*.
> +       my $diffrepo = Git->repository(Repository => $repo_path, WorkingCopy => $workdir);
> +       my $diffrtn = $diffrepo->command_oneline('diff', '--raw', '--no-abbrev', '-z', @ARGV);
> +       exit(0) if (length($diffrtn) == 0);
> +
> +       if ($diffrtn =~ /::/) {
> +               print "Combined diff formats ('-c' and '--cc') are not supported in directory diff mode.\n";
> +               exit(1);
> +       }
> +
> +       # Setup temp directories
> +       my $tmpdir = tempdir('git-diffall.XXXXX', CLEANUP => 1, TMPDIR => 1);
> +       my $ldir = "$tmpdir/left";
> +       my $rdir = "$tmpdir/right";
> +       mkpath($ldir) or die $!;
> +       mkpath($rdir) or die $!;
> +
> +       # Build index info for left and right sides of the diff
> +       my $submodule_mode = "160000";
> +       my $symlink_mode = "120000";
> +       my $null_mode = "0" x 6;
> +       my $null_sha1 = "0" x 40;
> +       my $lindex = "";
> +       my $rindex = "";
Super super tiny nit....

When reading Perl I expect to see DQ used only when $variable interpolation is used. Can we use ' instead of " for these strings in the re-roll to address Junio's notes?

-- 
David
Previous: Junio C Hamano
Message 3 of 3 in “difftool: teach difftool to handle directory diffs”
  1. 8/9 difftool: teach difftool to handle directory diffsTim Henigan, Apr 20, 2012
  2. Junio C HamanoApr 20, 2012
  3. David AguilarApr 21, 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.