From: "Đoàn Trần Công Danh" <congdanhqx@gmail.com>
To: git@vger.kernel.org
Cc: "Đoàn Trần Công Danh" <congdanhqx@gmail.com>,
"Eric Sunshine" <sunshine@sunshineco.com>,
"Jeff King" <peff@peff.net>,
"Johannes Schindelin" <Johannes.Schindelin@gmx.de>,
"Torsten Bögershausen" <tboegi@web.de>,
"Junio C Hamano" <gitster@pobox.com>
Subject: [PATCH v3 0/8] fix test failure with busybox
Date: Wed, 25 Mar 2020 22:06:13 +0700 [thread overview]
Message-ID: <cover.1585148327.git.congdanhqx@gmail.com> (raw)
Despite non-compiance from busybox's sh(1), grep(1), diff(1), find(1)
Alpine Linux is still a popular choice for container these days.
Fix false-positive failure in testsuite when run in Alpine Linux.
Đoàn Trần Công Danh (8):
t4061: use POSIX compliant regex(7)
test-lib-functions: test_cmp: eval $GIT_TEST_CMP
t5003: drop the subshell in test_lazy_prereq
t5003: skip conversion test if unzip -a is unavailable
t5616: use rev-parse instead to get HEAD's object_id
t7063: drop non-POSIX argument "-ls" from find(1)
t4124: fix test for non-compliant diff(1)
t5703: feed raw data into test-tool unpack-sideband
t/helper/test-pkt-line.c | 2 +-
t/t4061-diff-indent.sh | 2 +-
t/t4124-apply-ws-rule.sh | 6 ++++++
t/t5003-archive-zip.sh | 24 ++++++++++++------------
t/t5616-partial-clone.sh | 2 +-
t/t5703-upload-pack-ref-in-want.sh | 5 +----
t/t7063-status-untracked-cache.sh | 2 +-
t/test-lib-functions.sh | 2 +-
8 files changed, 24 insertions(+), 21 deletions(-)
Range-diff against v2:
1: 34f96548de = 1: 088905ab6f t4061: use POSIX compliant regex(7)
2: 50f46986a6 = 2: 691d9d47ba test-lib-functions: test_cmp: eval $GIT_TEST_CMP
3: 8719a07753 = 3: 759a589b83 t5003: drop the subshell in test_lazy_prereq
4: 457eecaf9b = 4: e5b09c290c t5003: skip conversion test if unzip -a is unavailable
5: d3bc855e17 = 5: 1b8740018c t5616: use rev-parse instead to get HEAD's object_id
6: 64472ec3bc ! 6: abb21b9e51 t7063: drop non-POSIX argument "-ls" from find(1)
@@ Commit message
However, `-ls` flag isn't required by POSIX's find(1), and
busybox(1) doesn't implement it.
- From the original conversation, it seems like find(1) with "-type d"
- could trigger enough "lstat(2)" to ask FreeBSD update mtime.
-
- Use only filter "-type d" for now.
+ Use "-exec ls -ld {} +" instead.
Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
@@ t/t7063-status-untracked-cache.sh: GIT_FORCE_UNTRACKED_CACHE=true
sync_mtime () {
- find . -type d -ls >/dev/null
-+ find . -type d >/dev/null
++ find . -type d -exec ls -ld {} + >/dev/null
}
avoid_racy() {
7: 51df6dd12d ! 7: 0502171f0f t4124: fix test for non-compliant diff(1)
@@ Commit message
POSIX's diff(1) requires output in normal diff format.
However, busybox's diff's output is written in unified format.
- POSIX requires no option for normal-diff format.
+ HP-UX's diff(1) doesn't understand "-u" as of now.
- A hint in test-lib-functions::test_cmp said `diff -u` isn't available
- everywhere.
-
- Workaround this problem by assuming `diff(1)` output is unified
+ Workaround this problem by checking "diff -u" output,
if we couldn't make anything from normal-diff format.
Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>
@@ t/t4124-apply-ws-rule.sh: test_fix () {
# find touched lines
$DIFF file target | sed -n -e "s/^> //p" >fixed
-+ # busybox's diff(1) output unified format
++ # busybox's diff(1) doesn't output normal format
+ if ! test -s fixed; then
-+ $DIFF file target |
++ $DIFF -u file target |
+ grep -v '^+++ target' |
+ sed -e "/^+/s/+//" >fixed
+ fi
8: 843c7f66d9 = 8: 8689e03400 t5703: feed raw data into test-tool unpack-sideband
--
2.26.0.rc2.357.g1e1ba0441d
next reply other threads:[~2020-03-25 15:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-25 15:06 Đoàn Trần Công Danh [this message]
2020-03-25 15:06 ` [PATCH v3 1/8] t4061: use POSIX compliant regex(7) Đoàn Trần Công Danh
2020-03-25 15:06 ` [PATCH v3 2/8] test-lib-functions: test_cmp: eval $GIT_TEST_CMP Đoàn Trần Công Danh
2020-03-25 15:06 ` [PATCH v3 3/8] t5003: drop the subshell in test_lazy_prereq Đoàn Trần Công Danh
2020-03-25 15:06 ` [PATCH v3 4/8] t5003: skip conversion test if unzip -a is unavailable Đoàn Trần Công Danh
2020-03-25 15:06 ` [PATCH v3 5/8] t5616: use rev-parse instead to get HEAD's object_id Đoàn Trần Công Danh
2020-03-25 15:06 ` [PATCH v3 6/8] t7063: drop non-POSIX argument "-ls" from find(1) Đoàn Trần Công Danh
2020-03-25 15:06 ` [PATCH v3 7/8] t4124: fix test for non-compliant diff(1) Đoàn Trần Công Danh
2020-03-25 15:06 ` [PATCH v3 8/8] t5703: feed raw data into test-tool unpack-sideband Đoàn Trần Công Danh
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=cover.1585148327.git.congdanhqx@gmail.com \
--to=congdanhqx@gmail.com \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
--cc=sunshine@sunshineco.com \
--cc=tboegi@web.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.