t4061: use POSIX compliance regex(7)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH v2 1/6 t4061: use POSIX compliance regex(7)
BRE interprets + literally, and\+ is undefined for POSIX BRE, from:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_03_02
Quoted 5 lines
The interpretation of an ordinary character preceded by an unescaped <backslash> ( '\\' ) is undefined, except for:
- The characters ')', '(', '{', and '}'
- The digits 1 to 9 inclusive
- A character inside a bracket expression
This test is failing with busybox sed, the default sed of Alpine Linux
Fix it by using literal + instead.
--- t/t4061-diff-indent.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
t/t4061-diff-indent.sh +1 -1
@@ -17,7 +17,7 @@ compare_diff () { # Compare blame output using the expectation for a diff as reference. # Only look for the lines coming from non-boundary commits. compare_blame () { - sed -n -e "1,4d" -e "s/^\+//p" <"$1" >.tmp-1 + sed -n -e "1,4d" -e "s/^+//p" <"$1" >.tmp-1 sed -ne "s/^[^^][^)]*) *//p" <"$2" >.tmp-2 test_cmp .tmp-1 .tmp-2 && rm -f .tmp-1 .tmp-2 }
Signature · 1 line
2.26.0.rc2.310.g2932bb562d
Quoted 10 lines · Đoàn Trần Công Danh
BRE interprets
+literally, and\+is undefined for POSIX BRE, from:
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_03_02Quoted 5 lines
The interpretation of an ordinary character preceded by an unescaped <backslash> ( '\\' ) is undefined, except for:
- The characters ')', '(', '{', and '}'
- The digits 1 to 9 inclusive
- A character inside a bracket expression
Quoted 5 lines
This test is failing with busybox sed, the default sed of Alpine Linux
Fix it by using literal
+instead.Signed-off-by Đoàn Trần Công Danh <[email protected]>
Due to error in my part, please ignore the v2 with 6 patches. It's the same with v1.
Please look into v2 with 8 patches instead.
Sorry for the noise.
Signature · 1 line
Danh
PATCH v2 3/6 t5003: skip conversion test if unzip -a is unavailable
In reply to a message not in the archiveAlpine Linux's default unzip(1) doesn't support -a.
Skip those tests on that platform.
--- t/t5003-archive-zip.sh | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-)
t/t5003-archive-zip.sh +14 -6
@@ -15,6 +15,14 @@ test_lazy_prereq UNZIP_SYMLINKS ' ) ' +test_lazy_prereq UNZIP_CONVERT ' + ( + mkdir unzip-convert && + cd unzip-convert && + "$GIT_UNZIP" -a "$TEST_DIRECTORY"/t5003/infozip-symlinks.zip + ) +' + check_zip() { zipfile=$1.zip listfile=$1.lst
@@ -39,33 +47,33 @@ check_zip() { extracted=${dir_with_prefix}a original=a - test_expect_success UNZIP " extract ZIP archive with EOL conversion" ' + test_expect_success UNZIP_CONVERT " extract ZIP archive with EOL conversion" ' (mkdir $dir && cd $dir && "$GIT_UNZIP" -a ../$zipfile) ' - test_expect_success UNZIP " validate that text files are converted" " + test_expect_success UNZIP_CONVERT " validate that text files are converted" " test_cmp_bin $extracted/text.cr $extracted/text.crlf && test_cmp_bin $extracted/text.cr $extracted/text.lf " - test_expect_success UNZIP " validate that binary files are unchanged" " + test_expect_success UNZIP_CONVERT " validate that binary files are unchanged" " test_cmp_bin $original/binary.cr $extracted/binary.cr && test_cmp_bin $original/binary.crlf $extracted/binary.crlf && test_cmp_bin $original/binary.lf $extracted/binary.lf " - test_expect_success UNZIP " validate that diff files are converted" " + test_expect_success UNZIP_CONVERT " validate that diff files are converted" " test_cmp_bin $extracted/diff.cr $extracted/diff.crlf && test_cmp_bin $extracted/diff.cr $extracted/diff.lf " - test_expect_success UNZIP " validate that -diff files are unchanged" " + test_expect_success UNZIP_CONVERT " validate that -diff files are unchanged" " test_cmp_bin $original/nodiff.cr $extracted/nodiff.cr && test_cmp_bin $original/nodiff.crlf $extracted/nodiff.crlf && test_cmp_bin $original/nodiff.lf $extracted/nodiff.lf " - test_expect_success UNZIP " validate that custom diff is unchanged " " + test_expect_success UNZIP_CONVERT " validate that custom diff is unchanged " " test_cmp_bin $original/custom.cr $extracted/custom.cr && test_cmp_bin $original/custom.crlf $extracted/custom.crlf && test_cmp_bin $original/custom.lf $extracted/custom.lf
Signature · 1 line
2.26.0.rc2.310.g2932bb562d
PATCH v2 4/6 t5616: use rev-parse instead to get HEAD's object_id
In reply to a message not in the archiveOnly HEAD's object_id is necessary, rev-list is an overkill.
Despite POSIX requires grep(1) treat single pattern with <newline> as multiple patterns.
busybox's grep(1) (as of v1.31.1) haven't implemented it yet.
Use rev-parse to simplify the test and avoid busybox unimplemented features.
--- t/t5616-partial-clone.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
t/t5616-partial-clone.sh +1 -1
@@ -49,7 +49,7 @@ test_expect_success 'do partial clone 1' ' test_expect_success 'verify that .promisor file contains refs fetched' ' ls pc1/.git/objects/pack/pack-*.promisor >promisorlist && test_line_count = 1 promisorlist && - git -C srv.bare rev-list HEAD >headhash && + git -C srv.bare rev-parse HEAD >headhash && grep "$(cat headhash) HEAD" $(cat promisorlist) && grep "$(cat headhash) refs/heads/master" $(cat promisorlist) '
Signature · 1 line
2.26.0.rc2.310.g2932bb562d
PATCH v2 5/6 t7063: use POSIX find(1) syntax
In reply to a message not in the archiveSince commit 6b7728db81, (t7063: work around FreeBSD's lazy mtime update feature, 2016-08-03), we started to use ls as a trick to update directory's mtime.
However, -ls flag isn't required by POSIX's find(1), and busybox(1) doesn't implement it.
Use an equivalence -exec ls -dils {} + instead.
--- t/t7063-status-untracked-cache.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
t/t7063-status-untracked-cache.sh +1 -1
@@ -18,7 +18,7 @@ GIT_FORCE_UNTRACKED_CACHE=true export GIT_FORCE_UNTRACKED_CACHE sync_mtime () { - find . -type d -ls >/dev/null + find . -type d -exec ls -dils {} + >/dev/null } avoid_racy() {
Signature · 1 line
2.26.0.rc2.310.g2932bb562d
PATCH v2 6/6 t4124: fix test for non-compliance diff
In reply to a message not in the archivePOSIX'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.
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 if we couldn't make anything from normal-diff format.
--- t/t4124-apply-ws-rule.sh | 6 ++++++ 1 file changed, 6 insertions(+)
t/t4124-apply-ws-rule.sh +6 -0
@@ -52,6 +52,12 @@ test_fix () { # find touched lines $DIFF file target | sed -n -e "s/^> //p" >fixed + if ! test -s fixed; then + $DIFF file target | + grep '^+' | + grep -v '^+++' | + sed -e "s/+//" >fixed + fi # the changed lines are all expected to change fixed_cnt=$(wc -l <fixed)
Signature · 1 line
2.26.0.rc2.310.g2932bb562d