Re: [PATCH 8/9 v11] difftool: teach difftool to handle directory diffs
- From
Tim Henigan <tim.henigan@gmail.com>
- Date
- Apr 10, 2012, 17:24 UTC
- Message-ID
- <CAFouetijF5vt9r1GfbntJ0BEqoo0FpztkeqrmeN=-6DK1Q_XRA@mail.gmail.com>
- In-Reply-To
- <CAJDDKr76eMiA4rOHQhar3aToVThDfbc8Ki5tr2PGU_UpDMAVeA@mail.gmail.com>
On Mon, Apr 9, 2012 at 8:14 AM, David Aguilar <davvid@gmail.com> wrote:
Show 6 quoted lines
> On Wed, Apr 4, 2012 at 12:21 PM, Tim Henigan <tim.henigan@gmail.com> wrote: >> diff --git a/git-difftool.perl b/git-difftool.perl >> index d4fe998..5bb01e1 100755 >> --- a/git-difftool.perl >> +++ b/git-difftool.perl >> @@ -1,21 +1,29 @@
...snip...
Show 6 quoted lines
>> + $ENV{GIT_DIR} = $repo->repo_path();
>> + $ENV{GIT_INDEX_FILE} = "$tmpdir/lindex";
>> + ($inpipe, $ctx) = $repo->command_input_pipe(qw/update-index -z --index-info/);
>> + print($inpipe $lindex);
>> + $repo->command_close_pipe($inpipe, $ctx);
>> + system(('git', 'checkout-index', '--all', "--prefix=$ldir/"));...snip...
Show 7 quoted lines
>> + # If the diff including working copy files and those >> + # files were modified during the diff, then the changes >> + # should be copied back to the working tree >> + my $repo = Git->repository(); >> + my $workdir = $repo->repo_path() . "/.."; > > Does this work when $GIT_WORK_TREE / core.worktree are defined?
Should I also be concerned that the existing code always overrides $GIT_DIR?
For example, should I squash in the following before calling 'git update-index'?
- $ENV{GIT_DIR} = $repo->repo_path();
+ if (not defined($ENV{GIT_DIR})) {
+ $ENV{GIT_DIR} = $repo->repo_path();
+ }This seems like the right thing to do, but again I have not used $GIT_DIR except for the implementation of this script.