<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/git-difftool.perl, branch v2.11.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.11.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.11.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-01-17T23:14:40Z</updated>
<entry>
<title>Merge branch 'jk/difftool-in-subdir' into maint</title>
<updated>2017-01-17T23:14:40Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-01-17T23:11:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a558332f5eda1f9d4cb4abe0e68062c625e5049f'/>
<id>urn:sha1:a558332f5eda1f9d4cb4abe0e68062c625e5049f</id>
<content type='text'>
Even though an fix was attempted in Git 2.9.3 days, but running
"git difftool --dir-diff" from a subdirectory never worked. This
has been fixed.

* jk/difftool-in-subdir:
  difftool: rename variables for consistency
  difftool: chdir as early as possible
  difftool: sanitize $workdir as early as possible
  difftool: fix dir-diff index creation when in a subdirectory
</content>
</entry>
<entry>
<title>difftool: rename variables for consistency</title>
<updated>2016-12-12T00:18:59Z</updated>
<author>
<name>David Aguilar</name>
<email>davvid@gmail.com</email>
</author>
<published>2016-12-09T08:58:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ce6926974ec7b28ad43c387d5aa8ae7ea9f72e65'/>
<id>urn:sha1:ce6926974ec7b28ad43c387d5aa8ae7ea9f72e65</id>
<content type='text'>
Always call the list of files @files.
Always call the worktree $worktree.

Signed-off-by: David Aguilar &lt;davvid@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>difftool: chdir as early as possible</title>
<updated>2016-12-12T00:18:54Z</updated>
<author>
<name>David Aguilar</name>
<email>davvid@gmail.com</email>
</author>
<published>2016-12-09T08:58:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f242a03d7330a68baf0748e595c0b2290d3a05a5'/>
<id>urn:sha1:f242a03d7330a68baf0748e595c0b2290d3a05a5</id>
<content type='text'>
Make difftool chdir to the top-level of the repository as soon as it can
so that we can simplify how paths are handled.  Replace construction of
absolute paths via string concatenation with relative paths wherever
possible.  The bulk of the code no longer needs to use absolute paths.

Signed-off-by: David Aguilar &lt;davvid@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>difftool: sanitize $workdir as early as possible</title>
<updated>2016-12-12T00:18:53Z</updated>
<author>
<name>David Aguilar</name>
<email>davvid@gmail.com</email>
</author>
<published>2016-12-09T08:58:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e6e3e2a67c8dacb0ed726f09cf203568f24f8e74'/>
<id>urn:sha1:e6e3e2a67c8dacb0ed726f09cf203568f24f8e74</id>
<content type='text'>
The double-slash fixup on the $workdir variable was being
performed just-in-time to avoid double-slashes in symlink
targets, but the rest of the code was silently using paths with
embedded "//" in them.

A recent user-reported error message contained double-slashes.
Eliminate the issue by sanitizing inputs as soon as they arrive.

Signed-off-by: David Aguilar &lt;davvid@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>difftool: fix dir-diff index creation when in a subdirectory</title>
<updated>2016-12-12T00:18:31Z</updated>
<author>
<name>David Aguilar</name>
<email>davvid@gmail.com</email>
</author>
<published>2016-12-07T10:16:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=86defcbe3f6c54a31dc898cb3adb4a3b25f1eb1a'/>
<id>urn:sha1:86defcbe3f6c54a31dc898cb3adb4a3b25f1eb1a</id>
<content type='text'>
9ec26e7977 (difftool: fix argument handling in subdirs, 2016-07-18)
corrected how path arguments are handled in a subdirectory, but
it introduced a regression in how entries outside of the
subdirectory are handled by dir-diff.

When preparing the right-side of the diff we only include the
changed paths in the temporary area.

The left side of the diff is constructed from a temporary
index that is built from the same set of changed files, but it
was being constructed from within the subdirectory.  This is a
problem because the indexed paths are toplevel-relative, and
thus they were not getting added to the index.

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 test cases to more thoroughly exercise this scenario.

Reported-by: Frank Becker &lt;fb@mooflu.com&gt;
Signed-off-by: David Aguilar &lt;davvid@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>difftool: fix dir-diff index creation when in a subdirectory</title>
<updated>2016-12-08T18:28:00Z</updated>
<author>
<name>David Aguilar</name>
<email>davvid@gmail.com</email>
</author>
<published>2016-12-07T10:16:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=853e10c19755669bd4695b1d9fd81f3278466727'/>
<id>urn:sha1:853e10c19755669bd4695b1d9fd81f3278466727</id>
<content type='text'>
9ec26e7977 (difftool: fix argument handling in subdirs, 2016-07-18)
corrected how path arguments are handled in a subdirectory, but
it introduced a regression in how entries outside of the
subdirectory are handled by dir-diff.

When preparing the right-side of the diff we only include the
changed paths in the temporary area.

The left side of the diff is constructed from a temporary
index that is built from the same set of changed files, but it
was being constructed from within the subdirectory.  This is a
problem because the indexed paths are toplevel-relative, and
thus they were not getting added to the index.

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 test cases to more thoroughly exercise this scenario.

Reported-by: Frank Becker &lt;fb@mooflu.com&gt;
Signed-off-by: David Aguilar &lt;davvid@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>difftool: use Git::* functions instead of passing around state</title>
<updated>2016-07-28T21:01:55Z</updated>
<author>
<name>David Aguilar</name>
<email>davvid@gmail.com</email>
</author>
<published>2016-07-19T03:57:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=32b8c581ecf35e73bebe2c6e9f6de617807b7f91'/>
<id>urn:sha1:32b8c581ecf35e73bebe2c6e9f6de617807b7f91</id>
<content type='text'>
Call Git::command() and friends directly wherever possible.
This makes it clear that these operations can be invoked directly
without needing to manage the current directory and related GIT_*
environment variables.

Eliminate find_repository() since we can now use wc_path() and
not worry about side-effects involving environment variables.

Signed-off-by: David Aguilar &lt;davvid@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>difftool: avoid $GIT_DIR and $GIT_WORK_TREE</title>
<updated>2016-07-28T21:01:55Z</updated>
<author>
<name>David Aguilar</name>
<email>davvid@gmail.com</email>
</author>
<published>2016-07-19T03:57:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=98f917ed421a477e0575c58f801ac25f0e261b9d'/>
<id>urn:sha1:98f917ed421a477e0575c58f801ac25f0e261b9d</id>
<content type='text'>
Environment variables are global and hard to reason about.
Use the `--git-dir` and `--work-tree` arguments when invoking `git`
instead of relying on the environment.

Add a test to ensure that difftool's dir-diff feature works when these
variables are present in the environment.

Signed-off-by: David Aguilar &lt;davvid@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>difftool: fix argument handling in subdirs</title>
<updated>2016-07-19T18:12:27Z</updated>
<author>
<name>John Keeping</name>
<email>john@keeping.me.uk</email>
</author>
<published>2016-07-19T03:57:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9ec26e797781239b36ebccb87c590e5778358007'/>
<id>urn:sha1:9ec26e797781239b36ebccb87c590e5778358007</id>
<content type='text'>
When in a subdirectory of a repository, path arguments should be
interpreted relative to the current directory not the root of the
working tree.

The Git::repository object passed into setup_dir_diff() is configured to
handle this correctly but we create a new Git::repository here without
setting the WorkingSubdir argument.  By simply using the existing
repository, path arguments are handled relative to the current
directory.

Reported-by: Bernhard Kirchen &lt;bernhard.kirchen@rwth-aachen.de&gt;
Signed-off-by: John Keeping &lt;john@keeping.me.uk&gt;
Acked-by: David Aguilar &lt;davvid@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>difftool: handle unmerged files in dir-diff mode</title>
<updated>2016-05-16T21:53:05Z</updated>
<author>
<name>David Aguilar</name>
<email>davvid@gmail.com</email>
</author>
<published>2016-05-16T18:05:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=366f9cea18fbb7ebb0a75735da8c2a9d5a916809'/>
<id>urn:sha1:366f9cea18fbb7ebb0a75735da8c2a9d5a916809</id>
<content type='text'>
When files are unmerged they can show up as both unmerged and
modified in the output of `git diff --raw`.  This causes
difftool's dir-diff to create filesystem entries for the same
path twice, which fails when it encounters a duplicate path.

Ensure that each worktree path is only processed once.
Add a test to demonstrate the breakage.

Reported-by: Jan Smets &lt;jan@smets.cx&gt;
Signed-off-by: David Aguilar &lt;davvid@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
