From: "Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail•com>
To: git@vger•kernel.org
Cc: Eric Sunshine <sunshine@sunshineco•com>,
Patrick Steinhardt <ps@pks•im>,
Johannes Schindelin <johannes.schindelin@gmx•de>,
Johannes Schindelin <johannes.schindelin@gmx•de>
Subject: [PATCH v4 10/10] t7800: work around the MSYS path conversion on Windows
Date: Wed, 17 Dec 2025 14:18:46 +0000 [thread overview]
Message-ID: <6caf8bf0b193f325ac4a3787b5619b8338154298.1765981126.git.gitgitgadget@gmail.com> (raw)
In-Reply-To: <pull.2009.v4.git.1765981126.gitgitgadget@gmail.com>
From: Johannes Schindelin <johannes.schindelin@gmx•de>
Git's test suite's relies on Unix shell scripting, which is
understandable, of course, given Git's firm roots (and indeed, ongoing
focus) on Linux.
This fact, combined with Unix shell scripting's natural
habitat -- which is, naturally... *drumroll*... Unix --
often has unintended side effects, where developers expect the test
suite to run in a Unix environment, which is an incorrect assumption.
One instance of this problem can be observed in the 'difftool --dir-diff
handles modified symlinks' test case in `t7800-difftool.sh`, which
assumes that all absolute paths start with a forward slash. That
assumption is incorrect in general, e.g. on Windows, where absolute
paths have many shapes and forms, none of which starts with a forward
slash.
The only saving grace is that this test case is currently not run on
Windows because of the `SYMLINK` prerequisite. However, I am currently
working towards upstreaming symbolic link support from Git for Windows
to upstream Git, which will put a crack into that saving grace.
Let's change that test case so that it does not rely on absolute paths
(which are passed to the "external command" `ls` as parameters and are
therefore part of its output, and which the test case wants to filter
out before verifying that the output is as expected) starting with a
forward slash. Let's instead rely on the much more reliable fact that
`ls` will output the path in a line that ends in a colon, and simply
filter out those lines by matching said colon instead.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx•de>
---
t/t7800-difftool.sh | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/t/t7800-difftool.sh b/t/t7800-difftool.sh
index 9b74db5563..bf0f67378d 100755
--- a/t/t7800-difftool.sh
+++ b/t/t7800-difftool.sh
@@ -752,11 +752,11 @@ test_expect_success SYMLINKS 'difftool --dir-diff handles modified symlinks' '
c
EOF
git difftool --symlinks --dir-diff --extcmd ls >output &&
- grep -v ^/ output >actual &&
+ grep -v ":\$" output >actual &&
test_cmp expect actual &&
git difftool --no-symlinks --dir-diff --extcmd ls >output &&
- grep -v ^/ output >actual &&
+ grep -v ":\$" output >actual &&
test_cmp expect actual &&
# The left side contains symlink "c" that points to "b"
@@ -786,11 +786,11 @@ test_expect_success SYMLINKS 'difftool --dir-diff handles modified symlinks' '
EOF
git difftool --symlinks --dir-diff --extcmd ls >output &&
- grep -v ^/ output >actual &&
+ grep -v ":\$" output >actual &&
test_cmp expect actual &&
git difftool --no-symlinks --dir-diff --extcmd ls >output &&
- grep -v ^/ output >actual &&
+ grep -v ":\$" output >actual &&
test_cmp expect actual
'
--
gitgitgadget
next prev parent reply other threads:[~2025-12-17 14:19 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-29 18:28 [PATCH 00/10] Prepare Git's test suite for symbolic link support on Windows Johannes Schindelin via GitGitGadget
2025-11-29 18:28 ` [PATCH 01/10] t9700: accommodate for Windows paths Johannes Schindelin via GitGitGadget
2025-11-29 18:28 ` [PATCH 02/10] apply: symbolic links lack a "trustable executable bit" Johannes Schindelin via GitGitGadget
2025-11-29 18:28 ` [PATCH 03/10] mingw: special-case `open(symlink, O_CREAT | O_EXCL)` Johannes Schindelin via GitGitGadget
2025-11-30 6:49 ` Junio C Hamano
2025-12-01 13:18 ` Johannes Schindelin
2025-12-06 2:17 ` Junio C Hamano
2025-11-29 18:28 ` [PATCH 04/10] t0001: handle `diff --no-index` gracefully Johannes Schindelin via GitGitGadget
2025-11-30 5:59 ` Junio C Hamano
2025-12-01 13:20 ` Johannes Schindelin
2025-12-02 8:15 ` Junio C Hamano
2025-11-29 18:28 ` [PATCH 05/10] t0301: another fix for Windows compatibility Johannes Schindelin via GitGitGadget
2025-11-30 6:09 ` Junio C Hamano
2025-12-01 13:25 ` Johannes Schindelin
2025-12-02 8:15 ` Junio C Hamano
2025-12-02 11:14 ` Johannes Schindelin
2025-12-06 1:05 ` Junio C Hamano
2025-11-29 18:28 ` [PATCH 06/10] t0600: fix incomplete prerequisite for a test case Johannes Schindelin via GitGitGadget
2025-12-01 9:46 ` Patrick Steinhardt
2025-12-01 13:27 ` Johannes Schindelin
2025-11-29 18:28 ` [PATCH 07/10] t1006: accommodate for symlink support in MSYS2 Johannes Schindelin via GitGitGadget
2025-12-01 9:47 ` Patrick Steinhardt
2025-12-01 13:29 ` Johannes Schindelin
2025-12-01 13:34 ` Patrick Steinhardt
2025-11-29 18:28 ` [PATCH 08/10] t1305: skip symlink tests that do not apply to Windows Johannes Schindelin via GitGitGadget
2025-11-29 18:28 ` [PATCH 09/10] t6423: introduce Windows-specific handling for symlinking to /dev/null Johannes Schindelin via GitGitGadget
2025-11-29 18:28 ` [PATCH 10/10] t7800: work around the MSYS path conversion on Windows Johannes Schindelin via GitGitGadget
2025-11-30 6:49 ` Junio C Hamano
2025-11-30 6:57 ` Eric Sunshine
2025-12-01 13:30 ` Johannes Schindelin
2025-12-05 15:02 ` [PATCH v2 00/10] Prepare Git's test suite for symbolic link support " Johannes Schindelin via GitGitGadget
2025-12-05 15:02 ` [PATCH v2 01/10] t9700: accommodate for Windows paths Johannes Schindelin via GitGitGadget
2025-12-05 15:02 ` [PATCH v2 02/10] apply: symbolic links lack a "trustable executable bit" Johannes Schindelin via GitGitGadget
2025-12-05 15:02 ` [PATCH v2 03/10] mingw: special-case `open(symlink, O_CREAT | O_EXCL)` Johannes Schindelin via GitGitGadget
2025-12-05 15:02 ` [PATCH v2 04/10] t0001: handle `diff --no-index` gracefully Johannes Schindelin via GitGitGadget
2025-12-05 15:02 ` [PATCH v2 05/10] t0301: another fix for Windows compatibility Johannes Schindelin via GitGitGadget
2025-12-05 15:02 ` [PATCH v2 06/10] t0600: fix incomplete prerequisite for a test case Johannes Schindelin via GitGitGadget
2025-12-05 15:02 ` [PATCH v2 07/10] t1006: accommodate for symlink support in MSYS2 Johannes Schindelin via GitGitGadget
2025-12-05 15:02 ` [PATCH v2 08/10] t1305: skip symlink tests that do not apply to Windows Johannes Schindelin via GitGitGadget
2025-12-05 15:02 ` [PATCH v2 09/10] t6423: introduce Windows-specific handling for symlinking to /dev/null Johannes Schindelin via GitGitGadget
2025-12-05 15:02 ` [PATCH v2 10/10] t7800: work around the MSYS path conversion on Windows Johannes Schindelin via GitGitGadget
2025-12-09 8:04 ` [PATCH v2 00/10] Prepare Git's test suite for symbolic link support " Patrick Steinhardt
2025-12-09 22:18 ` Junio C Hamano
2025-12-16 11:46 ` [PATCH v3 " Johannes Schindelin via GitGitGadget
2025-12-16 11:46 ` [PATCH v3 01/10] t9700: accommodate for Windows paths Johannes Schindelin via GitGitGadget
2025-12-16 11:46 ` [PATCH v3 02/10] apply: symbolic links lack a "trustable executable bit" Johannes Schindelin via GitGitGadget
2025-12-16 11:46 ` [PATCH v3 03/10] mingw: special-case `open(symlink, O_CREAT | O_EXCL)` Johannes Schindelin via GitGitGadget
2025-12-16 11:46 ` [PATCH v3 04/10] t0001: handle `diff --no-index` gracefully Johannes Schindelin via GitGitGadget
2025-12-16 11:46 ` [PATCH v3 05/10] t0301: another fix for Windows compatibility Johannes Schindelin via GitGitGadget
2025-12-16 11:46 ` [PATCH v3 07/10] t1006: accommodate for symlink support in MSYS2 Johannes Schindelin via GitGitGadget
2025-12-16 11:46 ` [PATCH v3 08/10] t1305: skip symlink tests that do not apply to Windows Johannes Schindelin via GitGitGadget
2025-12-16 11:46 ` [PATCH v3 09/10] t6423: introduce Windows-specific handling for symlinking to /dev/null Johannes Schindelin via GitGitGadget
2025-12-16 11:46 ` [PATCH v3 10/10] t7800: work around the MSYS path conversion on Windows Johannes Schindelin via GitGitGadget
2025-12-16 18:42 ` [PATCH v3 00/10] Prepare Git's test suite for symbolic link support " Junio C Hamano
2025-12-16 19:35 ` Johannes Schindelin
2025-12-17 4:31 ` Junio C Hamano
2025-12-17 14:18 ` [PATCH v4 " Johannes Schindelin via GitGitGadget
2025-12-17 14:18 ` [PATCH v4 01/10] t9700: accommodate for Windows paths Johannes Schindelin via GitGitGadget
2025-12-17 14:18 ` [PATCH v4 02/10] apply: symbolic links lack a "trustable executable bit" Johannes Schindelin via GitGitGadget
2025-12-17 14:18 ` [PATCH v4 03/10] mingw: special-case `open(symlink, O_CREAT | O_EXCL)` Johannes Schindelin via GitGitGadget
2025-12-17 14:18 ` [PATCH v4 04/10] t0001: handle `diff --no-index` gracefully Johannes Schindelin via GitGitGadget
2025-12-17 14:18 ` [PATCH v4 05/10] t0301: another fix for Windows compatibility Johannes Schindelin via GitGitGadget
2025-12-17 14:18 ` [PATCH v4 06/10] t0600: fix incomplete prerequisite for a test case Johannes Schindelin via GitGitGadget
2025-12-17 14:18 ` [PATCH v4 07/10] t1006: accommodate for symlink support in MSYS2 Johannes Schindelin via GitGitGadget
2025-12-17 14:18 ` [PATCH v4 08/10] t1305: skip symlink tests that do not apply to Windows Johannes Schindelin via GitGitGadget
2025-12-17 14:18 ` [PATCH v4 09/10] t6423: introduce Windows-specific handling for symlinking to /dev/null Johannes Schindelin via GitGitGadget
2025-12-17 14:18 ` Johannes Schindelin via GitGitGadget [this message]
2025-12-17 23:19 ` [PATCH v4 00/10] Prepare Git's test suite for symbolic link support on Windows Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6caf8bf0b193f325ac4a3787b5619b8338154298.1765981126.git.gitgitgadget@gmail.com \
--to=gitgitgadget@gmail$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
--cc=johannes.schindelin@gmx$(echo .)de \
--cc=ps@pks$(echo .)im \
--cc=sunshine@sunshineco$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox