{"thread":{"id":"55755","subject":"[PATCH] t: use configured TAR instead of tar","startedAt":"2021-05-22T06:28:30Z","lastAt":"2021-05-22T18:58:51Z","messageCount":4,"participants":["Đoàn Trần Công Danh","Junio C Hamano","brian m. carlson"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"425288","messageId":"20210522062815.17083-1-congdanhqx@gmail.com","threadId":"55755","inReplyTo":null,"subject":"[PATCH] t: use configured TAR instead of tar","fromName":"Đoàn Trần Công Danh","fromEmail":"congdanhqx@gmail.com","sentAt":"2021-05-22T06:28:15Z","receivedAt":"2021-05-22T06:28:30Z","isPatch":true,"sender":{"key":"congdanhqx@gmail.com","avatar":"https://avatars.githubusercontent.com/u/42673067?v=4"},"body":"Despite that tar is available everywhere, it's not required by POSIX.\nAnd, we're allow users to specify which tar they want to use in Makefile\nknobs, and we prefer GNU tar in autotools script.\n\nIn our testsuite, 7 out of 9 tar-required-tests use \"$TAR\", the other\ntwo use \"tar\".\n\nLet's change the remaining two tests to \"$TAR\".\n\nSigned-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>\n---\n\n I found this when trying to remove tar from a chroot that used to test Git,\n such chroot has bsdtar, so I tried to set \"TAR = bsdtar\" in config.mak\n\n t/t3513-revert-submodule.sh | 4 ++--\n t/t6041-bisect-submodule.sh | 4 ++--\n 2 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t3513-revert-submodule.sh b/t/t3513-revert-submodule.sh\nindex 74cd96e582..8bfe3ed246 100755\n--- a/t/t3513-revert-submodule.sh\n+++ b/t/t3513-revert-submodule.sh\n@@ -14,7 +14,7 @@ test_description='revert can handle submodules'\n git_revert () {\n \tgit status -su >expect &&\n \tls -1pR * >>expect &&\n-\ttar cf \"$TRASH_DIRECTORY/tmp.tar\" * &&\n+\t\"$TAR\" cf \"$TRASH_DIRECTORY/tmp.tar\" * &&\n \tmay_only_be_test_must_fail \"$2\" &&\n \t$2 git checkout \"$1\" &&\n \tif test -n \"$2\"\n@@ -23,7 +23,7 @@ git_revert () {\n \tfi &&\n \tgit revert HEAD &&\n \trm -rf * &&\n-\ttar xf \"$TRASH_DIRECTORY/tmp.tar\" &&\n+\t\"$TAR\" xf \"$TRASH_DIRECTORY/tmp.tar\" &&\n \tgit status -su >actual &&\n \tls -1pR * >>actual &&\n \ttest_cmp expect actual &&\ndiff --git a/t/t6041-bisect-submodule.sh b/t/t6041-bisect-submodule.sh\nindex df1eff0fb8..82013fc903 100755\n--- a/t/t6041-bisect-submodule.sh\n+++ b/t/t6041-bisect-submodule.sh\n@@ -8,7 +8,7 @@ test_description='bisect can handle submodules'\n git_bisect () {\n \tgit status -su >expect &&\n \tls -1pR * >>expect &&\n-\ttar cf \"$TRASH_DIRECTORY/tmp.tar\" * &&\n+\t\"$TAR\" cf \"$TRASH_DIRECTORY/tmp.tar\" * &&\n \tGOOD=$(git rev-parse --verify HEAD) &&\n \tmay_only_be_test_must_fail \"$2\" &&\n \t$2 git checkout \"$1\" &&\n@@ -25,7 +25,7 @@ git_bisect () {\n \tgit bisect start &&\n \tgit bisect good $GOOD &&\n \trm -rf * &&\n-\ttar xf \"$TRASH_DIRECTORY/tmp.tar\" &&\n+\t\"$TAR\" xf \"$TRASH_DIRECTORY/tmp.tar\" &&\n \tgit status -su >actual &&\n \tls -1pR * >>actual &&\n \ttest_cmp expect actual &&\n-- \n2.32.0.rc0.32.g107691cb07\n\n"},{"id":"425289","messageId":"xmqqk0nrqn8q.fsf@gitster.g","threadId":"55755","inReplyTo":"20210522062815.17083-1-congdanhqx@gmail.com","subject":"Re: [PATCH] t: use configured TAR instead of tar","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2021-05-22T06:46:45Z","receivedAt":"2021-05-22T06:46:50Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Đoàn Trần Công Danh  <congdanhqx@gmail.com> writes:\n\n> Despite that tar is available everywhere, it's not required by POSIX.\n> And, we're allow users to specify which tar they want to use in Makefile\n\ns/we're/we/;\n\n> knobs, and we prefer GNU tar in autotools script.\n\nThe last part I didn't know about---it is sad if autotools require\nuse of gtar (but since use of autoconf and autotools is not required\nto build Git, I do not deeply care ;-)).\n\n> In our testsuite, 7 out of 9 tar-required-tests use \"$TAR\", the other\n> two use \"tar\".\n>\n> Let's change the remaining two tests to \"$TAR\".\n\nNice.\n"},{"id":"425290","messageId":"20210522071008.26790-1-congdanhqx@gmail.com","threadId":"55755","inReplyTo":"20210522062815.17083-1-congdanhqx@gmail.com","subject":"[PATCH v2] t: use configured TAR instead of tar","fromName":"Đoàn Trần Công Danh","fromEmail":"congdanhqx@gmail.com","sentAt":"2021-05-22T07:10:08Z","receivedAt":"2021-05-22T07:17:00Z","isPatch":true,"sender":{"key":"congdanhqx@gmail.com","avatar":"https://avatars.githubusercontent.com/u/42673067?v=4"},"body":"Despite that tar is available everywhere, it's not required by POSIX.\n\nIn our build system, users are allowed to specify which tar to be used\nin Makefile knobs. Furthermore, GNU tar (gtar) is prefered when autotools\nis being used.\n\nIn our testsuite, 7 out of 9 tar-required-tests use \"$TAR\", the other\ntwo use \"tar\".\n\nLet's change the remaining two tests to \"$TAR\".\n\nSigned-off-by: Đoàn Trần Công Danh <congdanhqx@gmail.com>\n---\n\n>> knobs, and we prefer GNU tar in autotools script.\n>\n> The last part I didn't know about---it is sad if autotools require\n> use of gtar (but since use of autoconf and autotools is not required\n> to build Git, I do not deeply care ;-)).\n\nI do not care, either. Just want to add more data points for this change.\n\nI've made a grammar error with v1, and I think two \"and\" in a sentence is not\ngood enough. Let's take this version instead.\n\nRange-diff against v1:\n1:  3a8ba467fc ! 1:  724a1a7a77 t: use configured TAR instead of tar\n    @@ Commit message\n         t: use configured TAR instead of tar\n     \n         Despite that tar is available everywhere, it's not required by POSIX.\n    -    And, we're allow users to specify which tar they want to use in Makefile\n    -    knobs, and we prefer GNU tar in autotools script.\n    +\n    +    In our build system, users are allowed to specify which tar to be used\n    +    in Makefile knobs. Furthermore, GNU tar (gtar) is prefered when autotools\n    +    is being used.\n     \n         In our testsuite, 7 out of 9 tar-required-tests use \"$TAR\", the other\n         two use \"tar\".\n\n t/t3513-revert-submodule.sh | 4 ++--\n t/t6041-bisect-submodule.sh | 4 ++--\n 2 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t3513-revert-submodule.sh b/t/t3513-revert-submodule.sh\nindex 74cd96e582..8bfe3ed246 100755\n--- a/t/t3513-revert-submodule.sh\n+++ b/t/t3513-revert-submodule.sh\n@@ -14,7 +14,7 @@ test_description='revert can handle submodules'\n git_revert () {\n \tgit status -su >expect &&\n \tls -1pR * >>expect &&\n-\ttar cf \"$TRASH_DIRECTORY/tmp.tar\" * &&\n+\t\"$TAR\" cf \"$TRASH_DIRECTORY/tmp.tar\" * &&\n \tmay_only_be_test_must_fail \"$2\" &&\n \t$2 git checkout \"$1\" &&\n \tif test -n \"$2\"\n@@ -23,7 +23,7 @@ git_revert () {\n \tfi &&\n \tgit revert HEAD &&\n \trm -rf * &&\n-\ttar xf \"$TRASH_DIRECTORY/tmp.tar\" &&\n+\t\"$TAR\" xf \"$TRASH_DIRECTORY/tmp.tar\" &&\n \tgit status -su >actual &&\n \tls -1pR * >>actual &&\n \ttest_cmp expect actual &&\ndiff --git a/t/t6041-bisect-submodule.sh b/t/t6041-bisect-submodule.sh\nindex df1eff0fb8..82013fc903 100755\n--- a/t/t6041-bisect-submodule.sh\n+++ b/t/t6041-bisect-submodule.sh\n@@ -8,7 +8,7 @@ test_description='bisect can handle submodules'\n git_bisect () {\n \tgit status -su >expect &&\n \tls -1pR * >>expect &&\n-\ttar cf \"$TRASH_DIRECTORY/tmp.tar\" * &&\n+\t\"$TAR\" cf \"$TRASH_DIRECTORY/tmp.tar\" * &&\n \tGOOD=$(git rev-parse --verify HEAD) &&\n \tmay_only_be_test_must_fail \"$2\" &&\n \t$2 git checkout \"$1\" &&\n@@ -25,7 +25,7 @@ git_bisect () {\n \tgit bisect start &&\n \tgit bisect good $GOOD &&\n \trm -rf * &&\n-\ttar xf \"$TRASH_DIRECTORY/tmp.tar\" &&\n+\t\"$TAR\" xf \"$TRASH_DIRECTORY/tmp.tar\" &&\n \tgit status -su >actual &&\n \tls -1pR * >>actual &&\n \ttest_cmp expect actual &&\n-- \n2.32.0.rc0.32.g107691cb07\n\n"},{"id":"425340","messageId":"YKlUYKNm0V6ReJ2f@camp.crustytoothpaste.net","threadId":"55755","inReplyTo":"xmqqk0nrqn8q.fsf@gitster.g","subject":"Re: [PATCH] t: use configured TAR instead of tar","fromName":"brian m. carlson","fromEmail":"sandals@crustytoothpaste.net","sentAt":"2021-05-22T18:58:40Z","receivedAt":"2021-05-22T18:58:51Z","isPatch":true,"sender":{"key":"sandals@crustytoothpaste.net","avatar":"https://avatars.githubusercontent.com/u/497054?v=4"},"body":"On 2021-05-22 at 06:46:45, Junio C Hamano wrote:\n> Đoàn Trần Công Danh  <congdanhqx@gmail.com> writes:\n> \n> > Despite that tar is available everywhere, it's not required by POSIX.\n> > And, we're allow users to specify which tar they want to use in Makefile\n> \n> s/we're/we/;\n> \n> > knobs, and we prefer GNU tar in autotools script.\n> \n> The last part I didn't know about---it is sad if autotools require\n> use of gtar (but since use of autoconf and autotools is not required\n> to build Git, I do not deeply care ;-)).\n\nI don't believe we do require it.  macOS ships bsdtar (that is, the one\nfrom libarchive) and to the best of my knowledge, everything works fine\nthere.\n\nI suspect the reason that gtar is preferred is because on some systems,\nthe tar(1) command is relatively incapable and doesn't support things\nlike POSIX tar archives or pax extensions.\n-- \nbrian m. carlson (he/him or they/them)\nHouston, Texas, US\n"}]}