{"thread":{"id":"53054","subject":"[PATCH v2 1/6] t4061: use POSIX compliance regex(7)","startedAt":"2020-03-22T00:56:01Z","lastAt":"2020-03-22T01:52:39Z","messageCount":6,"participants":["Đoàn Trần Công Danh","Danh Doan"],"isPatch":true,"patchVersion":2,"patchTotal":6},"messages":[{"id":"393672","messageId":"4830bd3aaf6cadc02c00732f8447646064a6ae3e.1584838133.git.congdanhqx@gmail.com","threadId":"53054","inReplyTo":"cover.1584838133.git.congdanhqx@gmail.com","subject":"[PATCH v2 1/6] t4061: use POSIX compliance regex(7)","fromName":"Đoàn Trần Công Danh","fromEmail":"congdanhqx@gmail.com","sentAt":"2020-03-22T00:55:10Z","receivedAt":"2020-03-22T00:56:01Z","isPatch":true,"sender":{"key":"congdanhqx@gmail.com","avatar":"https://avatars.githubusercontent.com/u/42673067?v=4"},"body":"BRE interprets `+` literally, and\n`\\+` is undefined for POSIX BRE, from:\nhttps://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_03_02\n\n> The interpretation of an ordinary character preceded\n> by an unescaped <backslash> ( '\\\\' ) is undefined, except for:\n> - The characters ')', '(', '{', and '}'\n> - The digits 1 to 9 inclusive\n> - A character inside a bracket expression\n\nThis test is failing with busybox sed, the default sed of Alpine Linux\n\nFix it by using literal `+` instead.\n\nSigned-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>\n---\n t/t4061-diff-indent.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t4061-diff-indent.sh b/t/t4061-diff-indent.sh\nindex 2affd7a100..0f7a6d97a8 100755\n--- a/t/t4061-diff-indent.sh\n+++ b/t/t4061-diff-indent.sh\n@@ -17,7 +17,7 @@ compare_diff () {\n # Compare blame output using the expectation for a diff as reference.\n # Only look for the lines coming from non-boundary commits.\n compare_blame () {\n-\tsed -n -e \"1,4d\" -e \"s/^\\+//p\" <\"$1\" >.tmp-1\n+\tsed -n -e \"1,4d\" -e \"s/^+//p\" <\"$1\" >.tmp-1\n \tsed -ne \"s/^[^^][^)]*) *//p\" <\"$2\" >.tmp-2\n \ttest_cmp .tmp-1 .tmp-2 && rm -f .tmp-1 .tmp-2\n }\n-- \n2.26.0.rc2.310.g2932bb562d\n\n"},{"id":"393676","messageId":"ddeeefeae2acec37a36ab90d98215b585b22df96.1584838133.git.congdanhqx@gmail.com","threadId":"53054","inReplyTo":"cover.1584838133.git.congdanhqx@gmail.com","subject":"[PATCH v2 3/6] t5003: skip conversion test if unzip -a is unavailable","fromName":"Đoàn Trần Công Danh","fromEmail":"congdanhqx@gmail.com","sentAt":"2020-03-22T00:55:14Z","receivedAt":"2020-03-22T00:56:09Z","isPatch":true,"sender":{"key":"congdanhqx@gmail.com","avatar":"https://avatars.githubusercontent.com/u/42673067?v=4"},"body":"Alpine Linux's default unzip(1) doesn't support `-a`.\n\nSkip those tests on that platform.\n\nSigned-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>\n---\n t/t5003-archive-zip.sh | 20 ++++++++++++++------\n 1 file changed, 14 insertions(+), 6 deletions(-)\n\ndiff --git a/t/t5003-archive-zip.sh b/t/t5003-archive-zip.sh\nindex 106eddbd85..78fb4bf323 100755\n--- a/t/t5003-archive-zip.sh\n+++ b/t/t5003-archive-zip.sh\n@@ -15,6 +15,14 @@ test_lazy_prereq UNZIP_SYMLINKS '\n \t)\n '\n \n+test_lazy_prereq UNZIP_CONVERT '\n+\t(\n+\t\tmkdir unzip-convert &&\n+\t\tcd unzip-convert &&\n+\t\t\"$GIT_UNZIP\" -a \"$TEST_DIRECTORY\"/t5003/infozip-symlinks.zip\n+\t)\n+'\n+\n check_zip() {\n \tzipfile=$1.zip\n \tlistfile=$1.lst\n@@ -39,33 +47,33 @@ check_zip() {\n \textracted=${dir_with_prefix}a\n \toriginal=a\n \n-\ttest_expect_success UNZIP \" extract ZIP archive with EOL conversion\" '\n+\ttest_expect_success UNZIP_CONVERT \" extract ZIP archive with EOL conversion\" '\n \t\t(mkdir $dir && cd $dir && \"$GIT_UNZIP\" -a ../$zipfile)\n \t'\n \n-\ttest_expect_success UNZIP \" validate that text files are converted\" \"\n+\ttest_expect_success UNZIP_CONVERT \" validate that text files are converted\" \"\n \t\ttest_cmp_bin $extracted/text.cr $extracted/text.crlf &&\n \t\ttest_cmp_bin $extracted/text.cr $extracted/text.lf\n \t\"\n \n-\ttest_expect_success UNZIP \" validate that binary files are unchanged\" \"\n+\ttest_expect_success UNZIP_CONVERT \" validate that binary files are unchanged\" \"\n \t\ttest_cmp_bin $original/binary.cr   $extracted/binary.cr &&\n \t\ttest_cmp_bin $original/binary.crlf $extracted/binary.crlf &&\n \t\ttest_cmp_bin $original/binary.lf   $extracted/binary.lf\n \t\"\n \n-\ttest_expect_success UNZIP \" validate that diff files are converted\" \"\n+\ttest_expect_success UNZIP_CONVERT \" validate that diff files are converted\" \"\n \t\ttest_cmp_bin $extracted/diff.cr $extracted/diff.crlf &&\n \t\ttest_cmp_bin $extracted/diff.cr $extracted/diff.lf\n \t\"\n \n-\ttest_expect_success UNZIP \" validate that -diff files are unchanged\" \"\n+\ttest_expect_success UNZIP_CONVERT \" validate that -diff files are unchanged\" \"\n \t\ttest_cmp_bin $original/nodiff.cr   $extracted/nodiff.cr &&\n \t\ttest_cmp_bin $original/nodiff.crlf $extracted/nodiff.crlf &&\n \t\ttest_cmp_bin $original/nodiff.lf   $extracted/nodiff.lf\n \t\"\n \n-\ttest_expect_success UNZIP \" validate that custom diff is unchanged \" \"\n+\ttest_expect_success UNZIP_CONVERT \" validate that custom diff is unchanged \" \"\n \t\ttest_cmp_bin $original/custom.cr   $extracted/custom.cr &&\n \t\ttest_cmp_bin $original/custom.crlf $extracted/custom.crlf &&\n \t\ttest_cmp_bin $original/custom.lf   $extracted/custom.lf\n-- \n2.26.0.rc2.310.g2932bb562d\n\n"},{"id":"393678","messageId":"ce976e850c277fff812610266c14b0db03c6295c.1584838133.git.congdanhqx@gmail.com","threadId":"53054","inReplyTo":"cover.1584838133.git.congdanhqx@gmail.com","subject":"[PATCH v2 4/6] t5616: use rev-parse instead to get HEAD's object_id","fromName":"Đoàn Trần Công Danh","fromEmail":"congdanhqx@gmail.com","sentAt":"2020-03-22T00:55:16Z","receivedAt":"2020-03-22T00:56:14Z","isPatch":true,"sender":{"key":"congdanhqx@gmail.com","avatar":"https://avatars.githubusercontent.com/u/42673067?v=4"},"body":"Only HEAD's object_id is necessary, rev-list is an overkill.\n\nDespite POSIX requires grep(1) treat single pattern with <newline>\nas multiple patterns.\nbusybox's grep(1) (as of v1.31.1) haven't implemented it yet.\n\nUse rev-parse to simplify the test and avoid busybox unimplemented\nfeatures.\n\nSigned-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>\n---\n t/t5616-partial-clone.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t5616-partial-clone.sh b/t/t5616-partial-clone.sh\nindex 77bb91e976..135187c5b5 100755\n--- a/t/t5616-partial-clone.sh\n+++ b/t/t5616-partial-clone.sh\n@@ -49,7 +49,7 @@ test_expect_success 'do partial clone 1' '\n test_expect_success 'verify that .promisor file contains refs fetched' '\n \tls pc1/.git/objects/pack/pack-*.promisor >promisorlist &&\n \ttest_line_count = 1 promisorlist &&\n-\tgit -C srv.bare rev-list HEAD >headhash &&\n+\tgit -C srv.bare rev-parse HEAD >headhash &&\n \tgrep \"$(cat headhash) HEAD\" $(cat promisorlist) &&\n \tgrep \"$(cat headhash) refs/heads/master\" $(cat promisorlist)\n '\n-- \n2.26.0.rc2.310.g2932bb562d\n\n"},{"id":"393680","messageId":"cd86febed9b2791436d5e61da58cd318dcf4a7f9.1584838133.git.congdanhqx@gmail.com","threadId":"53054","inReplyTo":"cover.1584838133.git.congdanhqx@gmail.com","subject":"[PATCH v2 6/6] t4124: fix test for non-compliance diff","fromName":"Đoàn Trần Công Danh","fromEmail":"congdanhqx@gmail.com","sentAt":"2020-03-22T00:55:19Z","receivedAt":"2020-03-22T00:56:18Z","isPatch":true,"sender":{"key":"congdanhqx@gmail.com","avatar":"https://avatars.githubusercontent.com/u/42673067?v=4"},"body":"POSIX's diff(1) requires output in normal diff format.\nHowever, busybox's diff's output is written in unified format.\n\nPOSIX requires no option for normal-diff format.\n\nA hint in test-lib-functions::test_cmp said `diff -u` isn't available\neverywhere.\n\nWorkaround this problem by assuming `diff(1)` output is unified\nif we couldn't make anything from normal-diff format.\n\nSigned-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>\n---\n t/t4124-apply-ws-rule.sh | 6 ++++++\n 1 file changed, 6 insertions(+)\n\ndiff --git a/t/t4124-apply-ws-rule.sh b/t/t4124-apply-ws-rule.sh\nindex 971a5a7512..2a54ce96b5 100755\n--- a/t/t4124-apply-ws-rule.sh\n+++ b/t/t4124-apply-ws-rule.sh\n@@ -52,6 +52,12 @@ test_fix () {\n \n \t# find touched lines\n \t$DIFF file target | sed -n -e \"s/^> //p\" >fixed\n+\tif ! test -s fixed; then\n+\t\t$DIFF file target |\n+\t\tgrep '^+' |\n+\t\tgrep -v '^+++' |\n+\t\tsed -e \"s/+//\" >fixed\n+\tfi\n \n \t# the changed lines are all expected to change\n \tfixed_cnt=$(wc -l <fixed)\n-- \n2.26.0.rc2.310.g2932bb562d\n\n"},{"id":"393681","messageId":"1993b28a12cca8f35b89811ee7fea59c280931f3.1584838133.git.congdanhqx@gmail.com","threadId":"53054","inReplyTo":"cover.1584838133.git.congdanhqx@gmail.com","subject":"[PATCH v2 5/6] t7063: use POSIX find(1) syntax","fromName":"Đoàn Trần Công Danh","fromEmail":"congdanhqx@gmail.com","sentAt":"2020-03-22T00:55:18Z","receivedAt":"2020-03-22T00:56:19Z","isPatch":true,"sender":{"key":"congdanhqx@gmail.com","avatar":"https://avatars.githubusercontent.com/u/42673067?v=4"},"body":"Since commit 6b7728db81, (t7063: work around FreeBSD's lazy mtime\nupdate feature, 2016-08-03), we started to use ls as a trick to update\ndirectory's mtime.\n\nHowever, `-ls` flag isn't required by POSIX's find(1), and\nbusybox(1) doesn't implement it.\n\nUse an equivalence `-exec ls -dils {} +` instead.\n\nSigned-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>\n---\n t/t7063-status-untracked-cache.sh | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t7063-status-untracked-cache.sh b/t/t7063-status-untracked-cache.sh\nindex 190ae149cf..c2731d445a 100755\n--- a/t/t7063-status-untracked-cache.sh\n+++ b/t/t7063-status-untracked-cache.sh\n@@ -18,7 +18,7 @@ GIT_FORCE_UNTRACKED_CACHE=true\n export GIT_FORCE_UNTRACKED_CACHE\n \n sync_mtime () {\n-\tfind . -type d -ls >/dev/null\n+\tfind . -type d -exec ls -dils {} + >/dev/null\n }\n \n avoid_racy() {\n-- \n2.26.0.rc2.310.g2932bb562d\n\n"},{"id":"393685","messageId":"20200322015233.GB11801@danh.dev","threadId":"53054","inReplyTo":"4830bd3aaf6cadc02c00732f8447646064a6ae3e.1584838133.git.congdanhqx@gmail.com","subject":"Re: [PATCH v2 1/6] t4061: use POSIX compliance regex(7)","fromName":"Danh Doan","fromEmail":"congdanhqx@gmail.com","sentAt":"2020-03-22T01:52:33Z","receivedAt":"2020-03-22T01:52:39Z","isPatch":true,"sender":{"key":"congdanhqx@gmail.com","avatar":"https://avatars.githubusercontent.com/u/42673067?v=4"},"body":"On 2020-03-22 07:55:10+0700, Đoàn Trần Công Danh <congdanhqx@gmail.com> wrote:\n> BRE interprets `+` literally, and\n> `\\+` is undefined for POSIX BRE, from:\n> https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_03_02\n> \n> > The interpretation of an ordinary character preceded\n> > by an unescaped <backslash> ( '\\\\' ) is undefined, except for:\n> > - The characters ')', '(', '{', and '}'\n> > - The digits 1 to 9 inclusive\n> > - A character inside a bracket expression\n> \n> This test is failing with busybox sed, the default sed of Alpine Linux\n> \n> Fix it by using literal `+` instead.\n> \n> Signed-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>\n\nDue to error in my part, please ignore the v2 with 6 patches.\nIt's the same with v1.\n\nPlease look into v2 with 8 patches instead.\n\nSorry for the noise.\n\n-- \nDanh\n"}]}