From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tim Henigan Subject: Re: [PATCH 7/9] difftool: teach difftool to handle directory diffs Date: Tue, 20 Mar 2012 16:17:51 -0400 Message-ID: References: <1331949574-15192-1-git-send-email-tim.henigan@gmail.com> <7vlimv5del.fsf@alter.siamese.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: davvid@gmail.com, git@vger.kernel.org To: Junio C Hamano X-From: git-owner@vger.kernel.org Tue Mar 20 21:18:01 2012 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SA5VF-0000TT-Tj for gcvg-git-2@plane.gmane.org; Tue, 20 Mar 2012 21:17:58 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756308Ab2CTURx convert rfc822-to-quoted-printable (ORCPT ); Tue, 20 Mar 2012 16:17:53 -0400 Received: from mail-iy0-f174.google.com ([209.85.210.174]:56216 "EHLO mail-iy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752576Ab2CTURw convert rfc822-to-8bit (ORCPT ); Tue, 20 Mar 2012 16:17:52 -0400 Received: by iagz16 with SMTP id z16so477733iag.19 for ; Tue, 20 Mar 2012 13:17:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=/FoOT7i9cmfj7sUax4Qj0Yp0azkM/uXZmU7gcch/CGg=; b=DLQiidGT2gCwZpQeH4xCyTCbHp2zNFsIGziWj2ADywkXEFyhJxNrb4D1iAZkJLOouH ErV4Y50pSRuk9V6N7MzhOueu+H7ymLmUf3a0Mdfr+V/C1MvehqnjueCXta65VlfmH6fH iIbjfDL/ClyDQ53Rp6i1Qq1Zi/cXJXBgkIDp6mdF4uFSkoX4gR+CcqnK1l9FS/otKXwQ AiPyUZGWhxlPi+Yi6lM1xDmQ23ApdI/27xekZ95AZroG+Zh6Cz1m+c9MGQpeOQ3jDITD Ywg6wvQKOO2kci4qlmrhBQ312DxtYi4cg9ov+H9vYzKMlNMDo23z0qmW/E5yhCj39kD5 arTQ== Received: by 10.50.187.231 with SMTP id fv7mr9877768igc.51.1332274671812; Tue, 20 Mar 2012 13:17:51 -0700 (PDT) Received: by 10.42.138.5 with HTTP; Tue, 20 Mar 2012 13:17:51 -0700 (PDT) In-Reply-To: <7vlimv5del.fsf@alter.siamese.dyndns.org> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: On Tue, Mar 20, 2012 at 2:35 PM, Junio C Hamano wro= te: > Tim Henigan writes: > >> However, when 'difftool --dir-diff' is run from a subdirectory of th= e >> Git repository, there are problems. >> =C2=A0 - The temporary index file generated by 'git update-index' ap= pears >> to be correct. >> =C2=A0 - 'git checkout-index --all --prefix=3D$tmp' command does not= work >> (output tmp dir is empty). > > Hrmph. > > $ rm -fr /tmp/xyz > $ cd Documentation > $ git checkout-index --all --prefix=3D/tmp/xyz/ > $ ls -F /tmp/xyz > Documentation/ > $ rm -fr /tmp/xyz > $ GIT_DIR=3D$(pwd)/../.git GIT_WORK_TREE=3D$(pwd) \ > =C2=A0git checkout-index --all --prefix=3D/tmp/xyz/ > $ ls -FC /tmp/xyz | head -2 > abspath.c =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 git-merge-octopus.sh* =C2=A0 =C2=A0 =C2=A0 reflog-walk.c > aclocal.m4 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0git-merge-one-file.sh* =C2=A0 =C2=A0 =C2=A0reflog-walk.h > > Be sure to have the trailing slash in $tmp. It turns out that 'Git::command_oneline()' does not honor environment variables set prior to calling the function. This change fixed the problem: - $repo->command_oneline(["checkout-index", "-a", "--prefix=3D$ldir/"])= ; + $ENV{GIT_DIR} =3D $repo->repo_path(); + system(('git', 'checkout-index', '-a', "--prefix=3D$ldir/")); I'm still testing, but will submit an updated patch soon.