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

Re: t7800 test failure

From
Junio C Hamano <gitster@pobox.com>
Date
May 24, 2016, 17:36 UTC
Message-ID
<xmqqfut75peg.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CALR6jEj67MA7CCHQ_jfdtAuGoo9wjPie0+a=e-BqJjoYtJ9oHw@mail.gmail.com>
Armin Kunaschik <megabreit@googlemail.com> writes:
Show 15 quoted lines
>> I wouldn't allow it in our scripted Porcelain, but the environment
>> of our test scripts are under our control, so I do not think it is a
>> problem ("ls piped to sed" has been an established idiom before
>> readlink(1) was widely accepted, by the way).
>
> I think so too. Maybe I can improve the sed expression a bit, but
> it will never be a universal readlink replacement. But it doesn't have to.
> It's defined locally for this one test only and it does the specific job.
>
>>> It would be acceptable as a fall-back if readlink is not present, but
>>> shouldn't activate the "ls" hack by default.
>>
>> Yup.
>
> Ok, how can this be implemented within the test environment?
I actually think an unconditional check like this is sufficient.
 t/t7800-difftool.sh | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index 7ce4cd7..f304228 100755
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
@@ -442,15 +442,16 @@ run_dir_diff_test 'difftool --dir-diff with unmerged files' '
 	test_cmp expect actual
 '
 
-write_script .git/CHECK_SYMLINKS <<\EOF
-for f in file file2 sub/sub
-do
-	echo "$f"
-	readlink "$2/$f"
-done >actual
-EOF
-
 test_expect_success PERL,SYMLINKS 'difftool --dir-diff --symlink without unstaged changes' '
+
+	write_script .git/CHECK_SYMLINKS <<-\EOF &&
+	for f in file file2 sub/sub
+	do
+		echo "$f"
+		ls -ld "$2/$f" | sed -e "s/.* -> //"
+	done >actual
+	EOF
+
 	cat >expect <<-EOF &&
 	file
 	$PWD/file
Previous: Armin KunaschikNext: Armin Kunaschik
Message 5 of 14 in “t7800 test failure”
  1. Armin KunaschikMay 24, 2016
  2. Matthieu MoyMay 24, 2016
  3. Junio C HamanoMay 24, 2016
  4. Armin KunaschikMay 24, 2016
  5. Junio C HamanoMay 24, 2016
  6. Armin KunaschikMay 25, 2016
  7. David AguilarMay 27, 2016
  8. Matthieu MoyMay 27, 2016
  9. t7800 readlink not foundArmin Kunaschik, May 31, 2016
  10. Torsten BögershausenMay 31, 2016
  11. Junio C HamanoMay 31, 2016
  12. Armin KunaschikJun 21, 2016
  13. Junio C HamanoJun 21, 2016
  14. Torsten BögershausenJun 21, 2016

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.