Re: difftool -d not populating left correctly when not in git root

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi David,

On Sun, 4 Dec 2016, David Aguilar wrote:

> Date: Sun, 4 Dec 2016 14:27:17 -0800
> Subject: [PATCH] difftool: properly handle being launched from a subdirectory
> 
> 9ec26e797781239b36ebccb87c590e5778358007 corrected how path arguments
> are handled in a subdirectory, but it introduced a regression in how
> entries outside of the subdirectory are handled by the dir-diff.
> 
> When preparing the right-side of the diff we only construct the parts
> that changed.
> 
> When constructing the left side we construct an index, but we were
> constructing it relative to the subdirectory, and thus it ends up empty
> because we are in a subdirectory and the paths are incorrect.
> 
> Teach difftool to chdir to the toplevel of the repository before
> preparing its temporary indexes.  This ensures that all of the
> toplevel-relative paths are valid.
> 
> Add a test case to exercise this use case.
> 
> Reported-by: Frank Becker <fb@xxxxxxxxxx>
> Signed-off-by: David Aguilar <davvid@xxxxxxxxx>

I applied this to my builtin-difftool branch (which, as per Peff's
suggestion, runs t7800 both with and without the builtin difftool) and the
tests pass:

https://github.com/dscho/git/commit/9b9a69c5ee975a4a2565343ae0a9199a6ac89609

Which means that the builtin difftool already had fixed the bug, more by
coincidence than by design, I have to admit.

Ciao,
Johannes



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]