Re: git difftool does does not respect current working directory
- From
David Aguilar <davvid@gmail.com>
- Date
- May 22, 2011, 06:14 UTC
- Message-ID
- <20110522061446.GA49297@gmail.com>
- In-Reply-To
- <4DD7874A.2050604@gmail.com>
On Sat, May 21, 2011 at 11:35:06AM +0200, Frédéric Heitzmann wrote:
Show 13 quoted lines
> Reading your replies, my understanding is : > - difftool is consistent with diff, and chdir to root directory. It > is seems indeed very common to have diffs showing from the root > directory. > - on the overhand, openning gvimdiff via difftool and having a new > cwd is for sure not consistent with usual gvim text editing. > > I am afraid I am going to need some gvim trick like : > $ git difftool -x "gvimdiff -f -d -c 'wincmd l' -c 'cd $PWD' " my_file > > Not sure that it is less messy though ;-) > If there is no stronger need to adapt git-difftool, for gvimdiff or > any other difftool, we could probably settle for it.
I think updating git-difftool--helper.sh to pass a chdir to vim might be just the thing to do. git-difftool.perl can be updated to set $GIT_DIFFTOOL_PWD so that the helper can use it as -c 'cd $GIT_DIFFTOOL_PWD'. I'll see if I can whip up a patch in a lil bit.
-- David