git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] difftool: support repositories with .git-files

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 25, 2014, 22:12 UTC
Message-ID
<xmqqd2ia6dvo.fsf@gitster.dls.corp.google.com>
In-Reply-To
<530CFE56.6040807@web.de>
Jens Lehmann <Jens.Lehmann@web.de> writes:
Show 13 quoted lines
>>> +test_expect_success PERL 'difftool properly honours gitlink and core.worktree' '
>>> +	git submodule add ./. submod/ule &&
>>> +	(
>>> +		cd submod/ule &&
>>> +		git difftool --tool=echo  --dir-diff --cached
>> 
>> In the context of this fix, finishing with 0 exit status may be all
>> we care about, but do we also care about things like in what
>> directory the tool is invoked in, what arguments and extra
>> environment settings (if any) it is given, and stuff like that?
>
> Sure. But I just intended to test the fix (and the test can easily
> be extended by people who know more about difftool than I do).

Yes, we need to start somewhere and I'd agree that it was a good starting point.

> Right, using echo was not the best choice here. I used it to avoid
> the dependency to meld...

Perhaps like this then? This is an "a monkey sees what difftool_test_setup does and then mimics" patch ;-).

 t/t7800-difftool.sh | 13 +++++++++++++
 1 file changed, 13 insertions(+)
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index 2418528..595f808 100755
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
@@ -434,4 +434,17 @@ test_expect_success PERL 'difftool --no-symlinks detects conflict ' '
 	)
 '
 
+test_expect_success PERL 'difftool properly honours gitlink and core.worktree' '
+	git submodule add ./. submod/ule &&
+	(
+		cd submod/ule &&
+		git config diff.tool checktrees &&
+		git config difftool.checktrees.cmd '\''
+			test -d "$LOCAL" && test -d "$REMOTE"
+		'\'' &&
+		echo further >>file &&
+		git difftool --tool=checktrees --dir-diff
+	)
+'
+
 test_done
Previous: Jens LehmannNext: Jens Lehmann
Message 6 of 8 in “difftool: support repositories with .git-files”
  1. difftool: support repositories with .git-filesDavid Aguilar, Feb 24, 2014
  2. Junio C HamanoFeb 24, 2014
  3. Jens LehmannFeb 24, 2014
  4. Junio C HamanoFeb 25, 2014
  5. Jens LehmannFeb 25, 2014
  6. Junio C HamanoFeb 25, 2014
  7. Jens LehmannFeb 27, 2014
  8. t7800: add a difftool test for .git-filesDavid Aguilar, Mar 5, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.