{"thread":{"id":"63751","subject":"[PATCH v2 0/7] move builtin help test to t1517","startedAt":"2025-07-06T21:41:14Z","lastAt":"2025-08-30T03:49:58Z","messageCount":53,"participants":["Usman Akinyemi","Junio C Hamano","D. Ben Knoble","Phillip Wood"],"isPatch":true,"patchVersion":2,"patchTotal":7},"messages":[{"id":"521381","messageId":"20250706214108.714499-1-usmanakinyemi202@gmail.com","threadId":"63751","inReplyTo":null,"subject":"[PATCH v2 0/7] move builtin help test to t1517","fromName":"Usman Akinyemi","fromEmail":"usmanakinyemi202@gmail.com","sentAt":"2025-07-06T21:41:01Z","receivedAt":"2025-07-06T21:41:14Z","isPatch":true,"sender":{"key":"usmanakinyemi202@gmail.com","avatar":"https://avatars.githubusercontent.com/u/86585626?v=4"},"body":"In patch series which contain this\n\"[*]: 43a8391977 (builtin/verify-tag: stop using `the_repository`, 2025-03-07)\"\nand some other builtin commands, the help test was added into their\nrespective test files. Since it better fits thats tests that check\ncommand behavior outside a repository should be in t/t1517-outside-repo.sh.\nPatrick suggest moving the test to t/t1517-outside-repo.sh.\n\nThis patch series moved the all the test.\n\nChanges since v1:\n  - Fix some typo\n\nUsman Akinyemi (7):\n  t/t1517: move checkout-index -h test to t1517\n  t/t1517: move for-each-ref -h test to t1517\n  t/t1517: move ls-files -h test to t1517\n  t/t1517: move pack-refs -h test to t1517\n  t/t1517: move send-pack -h test to t1517\n  t/t1517: move verify-commit -h test to t1517\n  t/t1517: move verify-tag -h test to t1517\n\n t/t0610-reftable-basics.sh      |  7 -----\n t/t1517-outside-repo.sh         | 49 +++++++++++++++++++++++++++++++++\n t/t2006-checkout-index-basic.sh |  7 -----\n t/t3004-ls-files-basic.sh       |  7 -----\n t/t5400-send-pack.sh            |  7 -----\n t/t6300-for-each-ref.sh         |  7 -----\n t/t7030-verify-tag.sh           |  7 -----\n t/t7510-signed-commit.sh        |  7 -----\n 8 files changed, 49 insertions(+), 49 deletions(-)\n\n-- \n2.50.0\n\n"},{"id":"521382","messageId":"20250706214108.714499-2-usmanakinyemi202@gmail.com","threadId":"63751","inReplyTo":"20250706214108.714499-1-usmanakinyemi202@gmail.com","subject":"[PATCH v2 1/7] t/t1517: move checkout-index -h test to t1517","fromName":"Usman Akinyemi","fromEmail":"usmanakinyemi202@gmail.com","sentAt":"2025-07-06T21:41:02Z","receivedAt":"2025-07-06T21:41:17Z","isPatch":true,"sender":{"key":"usmanakinyemi202@gmail.com","avatar":"https://avatars.githubusercontent.com/u/86585626?v=4"},"body":"The test 'checkout-index does not crash with -h' checks that\nthe command exits cleanly with usage information, both inside and\noutside of a repository.\n\nMove this test from \"t2006-checkout-index-basic.sh\" to\n\"t1517-outside-repo.sh\" since it better fits with tests that check\ncommand behavior outside a repository.\n\nSuggested-by: Patrick Steinhardt <ps@pks.im>\nSigned-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>\n---\n t/t1517-outside-repo.sh         | 7 +++++++\n t/t2006-checkout-index-basic.sh | 7 -------\n 2 files changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/t/t1517-outside-repo.sh b/t/t1517-outside-repo.sh\nindex 6824581317..98a453db58 100755\n--- a/t/t1517-outside-repo.sh\n+++ b/t/t1517-outside-repo.sh\n@@ -114,4 +114,11 @@ test_expect_success 'update-server-info does not crash with -h' '\n \ttest_grep \"[Uu]sage: git update-server-info \" usage\n '\n \n+test_expect_success 'checkout-index does not crash with -h' '\n+\ttest_expect_code 129 git checkout-index -h >usage &&Add commentMore actions\n+\ttest_grep \"[Uu]sage: git checkout-index \" usage &&\n+\ttest_expect_code 129 nongit git checkout-index -h >usage &&\n+\ttest_grep \"[Uu]sage: git checkout-index \" usage\n+'\n+\n test_done\ndiff --git a/t/t2006-checkout-index-basic.sh b/t/t2006-checkout-index-basic.sh\nindex fedd2cc097..bac231b167 100755\n--- a/t/t2006-checkout-index-basic.sh\n+++ b/t/t2006-checkout-index-basic.sh\n@@ -21,13 +21,6 @@ test_expect_success 'checkout-index -h in broken repository' '\n \ttest_grep \"[Uu]sage\" broken/usage\n '\n \n-test_expect_success 'checkout-index does not crash with -h' '\n-\ttest_expect_code 129 git checkout-index -h >usage &&\n-\ttest_grep \"[Uu]sage: git checkout-index \" usage &&\n-\ttest_expect_code 129 nongit git checkout-index -h >usage &&\n-\ttest_grep \"[Uu]sage: git checkout-index \" usage\n-'\n-\n test_expect_success 'checkout-index reports errors (cmdline)' '\n \ttest_must_fail git checkout-index -- does-not-exist 2>stderr &&\n \ttest_grep not.in.the.cache stderr\n-- \n2.50.0\n\n"},{"id":"521383","messageId":"20250706214108.714499-3-usmanakinyemi202@gmail.com","threadId":"63751","inReplyTo":"20250706214108.714499-1-usmanakinyemi202@gmail.com","subject":"[PATCH v2 2/7] t/t1517: move for-each-ref -h test to t1517","fromName":"Usman Akinyemi","fromEmail":"usmanakinyemi202@gmail.com","sentAt":"2025-07-06T21:41:03Z","receivedAt":"2025-07-06T21:41:21Z","isPatch":true,"sender":{"key":"usmanakinyemi202@gmail.com","avatar":"https://avatars.githubusercontent.com/u/86585626?v=4"},"body":"The test 'for-each-ref does not crash with -h' checks that\nthe command exits cleanly with usage information, both inside and\noutside of a repository.\n\nMove this test from \"t6300-for-each-ref.sh\" to\n\"t1517-outside-repo.sh\" since it better fits with tests that check\ncommand behavior outside a repository.\n\nSuggested-by: Patrick Steinhardt <ps@pks.im>\nSigned-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>\n---\n t/t1517-outside-repo.sh | 7 +++++++\n t/t6300-for-each-ref.sh | 7 -------\n 2 files changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/t/t1517-outside-repo.sh b/t/t1517-outside-repo.sh\nindex 98a453db58..92ad159b58 100755\n--- a/t/t1517-outside-repo.sh\n+++ b/t/t1517-outside-repo.sh\n@@ -121,4 +121,11 @@ test_expect_success 'checkout-index does not crash with -h' '\n \ttest_grep \"[Uu]sage: git checkout-index \" usage\n '\n \n+test_expect_success 'for-each-ref does not crash with -h' '\n+\ttest_expect_code 129 git for-each-ref -h >usage &&\n+\ttest_grep \"[Uu]sage: git for-each-ref \" usage &&\n+\ttest_expect_code 129 nongit git for-each-ref -h >usage &&\n+\ttest_grep \"[Uu]sage: git for-each-ref \" usage\n+'\n+\n test_done\ndiff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh\nindex ce9af79ab1..5db7038c41 100755\n--- a/t/t6300-for-each-ref.sh\n+++ b/t/t6300-for-each-ref.sh\n@@ -292,13 +292,6 @@ test_expect_success 'Check invalid atoms names are errors' '\n \ttest_must_fail git for-each-ref --format=\"%(INVALID)\" refs/heads\n '\n \n-test_expect_success 'for-each-ref does not crash with -h' '\n-\ttest_expect_code 129 git for-each-ref -h >usage &&\n-\ttest_grep \"[Uu]sage: git for-each-ref \" usage &&\n-\ttest_expect_code 129 nongit git for-each-ref -h >usage &&\n-\ttest_grep \"[Uu]sage: git for-each-ref \" usage\n-'\n-\n test_expect_success 'Check format specifiers are ignored in naming date atoms' '\n \tgit for-each-ref --format=\"%(authordate)\" refs/heads &&\n \tgit for-each-ref --format=\"%(authordate:default) %(authordate)\" refs/heads &&\n-- \n2.50.0\n\n"},{"id":"521384","messageId":"20250706214108.714499-4-usmanakinyemi202@gmail.com","threadId":"63751","inReplyTo":"20250706214108.714499-1-usmanakinyemi202@gmail.com","subject":"[PATCH v2 3/7] t/t1517: move ls-files -h test to t1517","fromName":"Usman Akinyemi","fromEmail":"usmanakinyemi202@gmail.com","sentAt":"2025-07-06T21:41:04Z","receivedAt":"2025-07-06T21:41:24Z","isPatch":true,"sender":{"key":"usmanakinyemi202@gmail.com","avatar":"https://avatars.githubusercontent.com/u/86585626?v=4"},"body":"The test 'ls-files does not crash with -h' checks that\nthe command exits cleanly with usage information, both inside and\noutside of a repository.\n\nMove this test from \"t3004-ls-files-basic.sh\" to\n\"t1517-outside-repo.sh\" since it better fits with tests that check\ncommand behavior outside a repository.\n\nSuggested-by: Patrick Steinhardt <ps@pks.im>\nSigned-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>\n---\n t/t1517-outside-repo.sh   | 7 +++++++\n t/t3004-ls-files-basic.sh | 7 -------\n 2 files changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/t/t1517-outside-repo.sh b/t/t1517-outside-repo.sh\nindex 92ad159b58..e04be2d811 100755\n--- a/t/t1517-outside-repo.sh\n+++ b/t/t1517-outside-repo.sh\n@@ -128,4 +128,11 @@ test_expect_success 'for-each-ref does not crash with -h' '\n \ttest_grep \"[Uu]sage: git for-each-ref \" usage\n '\n \n+test_expect_success 'ls-files does not crash with -h' '\n+\ttest_expect_code 129 git ls-files -h >usage &&\n+\ttest_grep \"[Uu]sage: git ls-files \" usage &&\n+\ttest_expect_code 129 nongit git ls-files -h >usage &&\n+\ttest_grep \"[Uu]sage: git ls-files \" usage\n+'\n+\n test_done\ndiff --git a/t/t3004-ls-files-basic.sh b/t/t3004-ls-files-basic.sh\nindex 4034a5a59f..a1078f8701 100755\n--- a/t/t3004-ls-files-basic.sh\n+++ b/t/t3004-ls-files-basic.sh\n@@ -34,13 +34,6 @@ test_expect_success 'ls-files -h in corrupt repository' '\n \ttest_grep \"[Uu]sage: git ls-files \" broken/usage\n '\n \n-test_expect_success 'ls-files does not crash with -h' '\n-\ttest_expect_code 129 git ls-files -h >usage &&\n-\ttest_grep \"[Uu]sage: git ls-files \" usage &&\n-\ttest_expect_code 129 nongit git ls-files -h >usage &&\n-\ttest_grep \"[Uu]sage: git ls-files \" usage\n-'\n-\n test_expect_success SYMLINKS 'ls-files with absolute paths to symlinks' '\n \tmkdir subs &&\n \tln -s nosuch link &&\n-- \n2.50.0\n\n"},{"id":"521385","messageId":"20250706214108.714499-5-usmanakinyemi202@gmail.com","threadId":"63751","inReplyTo":"20250706214108.714499-1-usmanakinyemi202@gmail.com","subject":"[PATCH v2 4/7] t/t1517: move pack-refs -h test to t1517","fromName":"Usman Akinyemi","fromEmail":"usmanakinyemi202@gmail.com","sentAt":"2025-07-06T21:41:05Z","receivedAt":"2025-07-06T21:41:27Z","isPatch":true,"sender":{"key":"usmanakinyemi202@gmail.com","avatar":"https://avatars.githubusercontent.com/u/86585626?v=4"},"body":"The test 'pack-refs does not crash with -h' checks that\nthe command exits cleanly with usage information, both inside and\noutside of a repository.\n\nMove this test from \"t0610-reftable-basics.sh\" to\n\"t1517-outside-repo.sh\" since it better fits with tests that check\ncommand behavior outside a repository.\n\nSuggested-by: Patrick Steinhardt <ps@pks.im>\nSigned-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>\n---\n t/t0610-reftable-basics.sh | 7 -------\n t/t1517-outside-repo.sh    | 7 +++++++\n 2 files changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/t/t0610-reftable-basics.sh b/t/t0610-reftable-basics.sh\nindex 3ea5d51532..ffd8ecc0ce 100755\n--- a/t/t0610-reftable-basics.sh\n+++ b/t/t0610-reftable-basics.sh\n@@ -14,13 +14,6 @@ export GIT_TEST_DEFAULT_REF_FORMAT\n \n INVALID_OID=$(test_oid 001)\n \n-test_expect_success 'pack-refs does not crash with -h' '\n-\ttest_expect_code 129 git pack-refs -h >usage &&\n-\ttest_grep \"[Uu]sage: git pack-refs \" usage &&\n-\ttest_expect_code 129 nongit git pack-refs -h >usage &&\n-\ttest_grep \"[Uu]sage: git pack-refs \" usage\n-'\n-\n test_expect_success 'init: creates basic reftable structures' '\n \ttest_when_finished \"rm -rf repo\" &&\n \tgit init repo &&\ndiff --git a/t/t1517-outside-repo.sh b/t/t1517-outside-repo.sh\nindex e04be2d811..5b4373f8cd 100755\n--- a/t/t1517-outside-repo.sh\n+++ b/t/t1517-outside-repo.sh\n@@ -135,4 +135,11 @@ test_expect_success 'ls-files does not crash with -h' '\n \ttest_grep \"[Uu]sage: git ls-files \" usage\n '\n \n+test_expect_success 'pack-refs does not crash with -h' '\n+\ttest_expect_code 129 git pack-refs -h >usage &&\n+\ttest_grep \"[Uu]sage: git pack-refs \" usage &&\n+\ttest_expect_code 129 nongit git pack-refs -h >usage &&\n+\ttest_grep \"[Uu]sage: git pack-refs \" usage\n+'\n+\n test_done\n-- \n2.50.0\n\n"},{"id":"521386","messageId":"20250706214108.714499-6-usmanakinyemi202@gmail.com","threadId":"63751","inReplyTo":"20250706214108.714499-1-usmanakinyemi202@gmail.com","subject":"[PATCH v2 5/7] t/t1517: move send-pack -h test to t1517","fromName":"Usman Akinyemi","fromEmail":"usmanakinyemi202@gmail.com","sentAt":"2025-07-06T21:41:06Z","receivedAt":"2025-07-06T21:41:31Z","isPatch":true,"sender":{"key":"usmanakinyemi202@gmail.com","avatar":"https://avatars.githubusercontent.com/u/86585626?v=4"},"body":"The test 'send-pack does not crash with -h' checks that\nthe command exits cleanly with usage information, both inside and\noutside of a repository.\n\nMove this test from \"t/t5400-send-pack.sh\" to\n\"t1517-outside-repo.sh\" since it better fits with tests that check\ncommand behavior outside a repository.\n\nSuggested-by: Patrick Steinhardt <ps@pks.im>\nSigned-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>\n---\n t/t1517-outside-repo.sh | 7 +++++++\n t/t5400-send-pack.sh    | 7 -------\n 2 files changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/t/t1517-outside-repo.sh b/t/t1517-outside-repo.sh\nindex 5b4373f8cd..a140b5cc38 100755\n--- a/t/t1517-outside-repo.sh\n+++ b/t/t1517-outside-repo.sh\n@@ -142,4 +142,11 @@ test_expect_success 'pack-refs does not crash with -h' '\n \ttest_grep \"[Uu]sage: git pack-refs \" usage\n '\n \n+test_expect_success 'send-pack does not crash with -h' '\n+\ttest_expect_code 129 git send-pack -h >usage &&\n+\ttest_grep \"[Uu]sage: git send-pack \" usage &&\n+\ttest_expect_code 129 nongit git send-pack -h >usage &&\n+\ttest_grep \"[Uu]sage: git send-pack \" usage\n+'\n+\n test_done\ndiff --git a/t/t5400-send-pack.sh b/t/t5400-send-pack.sh\nindex 83b42ff073..571e8f1bc5 100755\n--- a/t/t5400-send-pack.sh\n+++ b/t/t5400-send-pack.sh\n@@ -55,13 +55,6 @@ test_expect_success setup '\n \techo Rebase &&\n \tgit log'\n \n-test_expect_success 'send-pack does not crash with -h' '\n-\ttest_expect_code 129 git send-pack -h >usage &&\n-\ttest_grep \"[Uu]sage: git send-pack \" usage &&\n-\ttest_expect_code 129 nongit git send-pack -h >usage &&\n-\ttest_grep \"[Uu]sage: git send-pack \" usage\n-'\n-\n test_expect_success 'pack the source repository' '\n \tgit repack -a -d &&\n \tgit prune\n-- \n2.50.0\n\n"},{"id":"521387","messageId":"20250706214108.714499-7-usmanakinyemi202@gmail.com","threadId":"63751","inReplyTo":"20250706214108.714499-1-usmanakinyemi202@gmail.com","subject":"[PATCH v2 6/7] t/t1517: move verify-commit -h test to t1517","fromName":"Usman Akinyemi","fromEmail":"usmanakinyemi202@gmail.com","sentAt":"2025-07-06T21:41:07Z","receivedAt":"2025-07-06T21:41:34Z","isPatch":true,"sender":{"key":"usmanakinyemi202@gmail.com","avatar":"https://avatars.githubusercontent.com/u/86585626?v=4"},"body":"The test 'verify-commit does not crash with -h' checks that\nthe command exits cleanly with usage information, both inside and\noutside of a repository.\n\nMove this test from \"t/t7510-signed-commit.sh\" to\n\"t1517-outside-repo.sh\" since it better fits with tests that check\ncommand behavior outside a repository.\n\nSuggested-by: Patrick Steinhardt <ps@pks.im>\nSigned-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>\n---\n t/t1517-outside-repo.sh  | 7 +++++++\n t/t7510-signed-commit.sh | 7 -------\n 2 files changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/t/t1517-outside-repo.sh b/t/t1517-outside-repo.sh\nindex a140b5cc38..42381ef7eb 100755\n--- a/t/t1517-outside-repo.sh\n+++ b/t/t1517-outside-repo.sh\n@@ -149,4 +149,11 @@ test_expect_success 'send-pack does not crash with -h' '\n \ttest_grep \"[Uu]sage: git send-pack \" usage\n '\n \n+test_expect_success 'verify-commit does not crash with -h' '\n+\ttest_expect_code 129 git verify-commit -h >usage &&\n+\ttest_grep \"[Uu]sage: git verify-commit \" usage &&\n+\ttest_expect_code 129 nongit git verify-commit -h >usage &&\n+\ttest_grep \"[Uu]sage: git verify-commit \" usage\n+'\n+\n test_done\ndiff --git a/t/t7510-signed-commit.sh b/t/t7510-signed-commit.sh\nindex 39677e859a..0d2dd29fe6 100755\n--- a/t/t7510-signed-commit.sh\n+++ b/t/t7510-signed-commit.sh\n@@ -8,13 +8,6 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n GNUPGHOME_NOT_USED=$GNUPGHOME\n . \"$TEST_DIRECTORY/lib-gpg.sh\"\n \n-test_expect_success GPG 'verify-commit does not crash with -h' '\n-\ttest_expect_code 129 git verify-commit -h >usage &&\n-\ttest_grep \"[Uu]sage: git verify-commit \" usage &&\n-\ttest_expect_code 129 nongit git verify-commit -h >usage &&\n-\ttest_grep \"[Uu]sage: git verify-commit \" usage\n-'\n-\n test_expect_success GPG 'create signed commits' '\n \ttest_oid_cache <<-\\EOF &&\n \theader sha1:gpgsig\n-- \n2.50.0\n\n"},{"id":"521388","messageId":"20250706214108.714499-8-usmanakinyemi202@gmail.com","threadId":"63751","inReplyTo":"20250706214108.714499-1-usmanakinyemi202@gmail.com","subject":"[PATCH v2 7/7] t/t1517: move verify-tag -h test to t1517","fromName":"Usman Akinyemi","fromEmail":"usmanakinyemi202@gmail.com","sentAt":"2025-07-06T21:41:08Z","receivedAt":"2025-07-06T21:41:37Z","isPatch":true,"sender":{"key":"usmanakinyemi202@gmail.com","avatar":"https://avatars.githubusercontent.com/u/86585626?v=4"},"body":"The test 'verify-tag does not crash with -h' checks that\nthe command exits cleanly with usage information, both inside and\noutside of a repository.\n\nMove this test from \"t/t7030-verify-tag.sh\" to\n\"t1517-outside-repo.sh\" since it better fits with tests that check\ncommand behavior outside a repository.\n\nSuggested-by: Patrick Steinhardt <ps@pks.im>\nSigned-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>\n---\n t/t1517-outside-repo.sh | 7 +++++++\n t/t7030-verify-tag.sh   | 7 -------\n 2 files changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/t/t1517-outside-repo.sh b/t/t1517-outside-repo.sh\nindex 42381ef7eb..0755757d86 100755\n--- a/t/t1517-outside-repo.sh\n+++ b/t/t1517-outside-repo.sh\n@@ -156,4 +156,11 @@ test_expect_success 'verify-commit does not crash with -h' '\n \ttest_grep \"[Uu]sage: git verify-commit \" usage\n '\n \n+test_expect_success 'verify-tag does not crash with -h' '\n+\ttest_expect_code 129 git verify-tag -h >usage &&\n+\ttest_grep \"[Uu]sage: git verify-tag \" usage &&\n+\ttest_expect_code 129 nongit git verify-tag -h >usage &&\n+\ttest_grep \"[Uu]sage: git verify-tag \" usage\n+'\n+\n test_done\ndiff --git a/t/t7030-verify-tag.sh b/t/t7030-verify-tag.sh\nindex 2c147072c1..6f526c37c2 100755\n--- a/t/t7030-verify-tag.sh\n+++ b/t/t7030-verify-tag.sh\n@@ -7,13 +7,6 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n . ./test-lib.sh\n . \"$TEST_DIRECTORY/lib-gpg.sh\"\n \n-test_expect_success GPG 'verify-tag does not crash with -h' '\n-\ttest_expect_code 129 git verify-tag -h >usage &&\n-\ttest_grep \"[Uu]sage: git verify-tag \" usage &&\n-\ttest_expect_code 129 nongit git verify-tag -h >usage &&\n-\ttest_grep \"[Uu]sage: git verify-tag \" usage\n-'\n-\n test_expect_success GPG 'create signed tags' '\n \techo 1 >file && git add file &&\n \ttest_tick && git commit -m initial &&\n-- \n2.50.0\n\n"},{"id":"521389","messageId":"20250706215039.715732-1-usmanakinyemi202@gmail.com","threadId":"63751","inReplyTo":"20250706214108.714499-1-usmanakinyemi202@gmail.com","subject":"[PATCH v2 0/7] move builtin help test to t1517","fromName":"Usman Akinyemi","fromEmail":"usmanakinyemi202@gmail.com","sentAt":"2025-07-06T21:50:32Z","receivedAt":"2025-07-06T21:50:46Z","isPatch":true,"sender":{"key":"usmanakinyemi202@gmail.com","avatar":"https://avatars.githubusercontent.com/u/86585626?v=4"},"body":"In patch series which contain this\n\"[*]: 43a8391977 (builtin/verify-tag: stop using `the_repository`, 2025-03-07)\"\nand some other builtin commands, the help test was added into their\nrespective test files. Since it better fits thats tests that check\ncommand behavior outside a repository should be in t/t1517-outside-repo.sh.\nPatrick suggest moving the test to t/t1517-outside-repo.sh.\n\nThis patch series moved the all the test.\n\nChanges since v3:\n  - Fix the typo which I thought I was able to fix in v2\n\nUsman Akinyemi (7):\n  t/t1517: move checkout-index -h test to t1517\n  t/t1517: move for-each-ref -h test to t1517\n  t/t1517: move ls-files -h test to t1517\n  t/t1517: move pack-refs -h test to t1517\n  t/t1517: move send-pack -h test to t1517\n  t/t1517: move verify-commit -h test to t1517\n  t/t1517: move verify-tag -h test to t1517\n\n t/t0610-reftable-basics.sh      |  7 -----\n t/t1517-outside-repo.sh         | 49 +++++++++++++++++++++++++++++++++\n t/t2006-checkout-index-basic.sh |  7 -----\n t/t3004-ls-files-basic.sh       |  7 -----\n t/t5400-send-pack.sh            |  7 -----\n t/t6300-for-each-ref.sh         |  7 -----\n t/t7030-verify-tag.sh           |  7 -----\n t/t7510-signed-commit.sh        |  7 -----\n 8 files changed, 49 insertions(+), 49 deletions(-)\n\n-- \n2.50.0\n\n"},{"id":"521390","messageId":"20250706215039.715732-2-usmanakinyemi202@gmail.com","threadId":"63751","inReplyTo":"20250706215039.715732-1-usmanakinyemi202@gmail.com","subject":"[PATCH v3 1/7] t/t1517: move checkout-index -h test to t1517","fromName":"Usman Akinyemi","fromEmail":"usmanakinyemi202@gmail.com","sentAt":"2025-07-06T21:50:33Z","receivedAt":"2025-07-06T21:50:49Z","isPatch":true,"sender":{"key":"usmanakinyemi202@gmail.com","avatar":"https://avatars.githubusercontent.com/u/86585626?v=4"},"body":"The test 'checkout-index does not crash with -h' checks that\nthe command exits cleanly with usage information, both inside and\noutside of a repository.\n\nMove this test from \"t2006-checkout-index-basic.sh\" to\n\"t1517-outside-repo.sh\" since it better fits with tests that check\ncommand behavior outside a repository.\n\nSuggested-by: Patrick Steinhardt <ps@pks.im>\nSigned-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>\n---\n t/t1517-outside-repo.sh         | 7 +++++++\n t/t2006-checkout-index-basic.sh | 7 -------\n 2 files changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/t/t1517-outside-repo.sh b/t/t1517-outside-repo.sh\nindex 6824581317..9e54214725 100755\n--- a/t/t1517-outside-repo.sh\n+++ b/t/t1517-outside-repo.sh\n@@ -114,4 +114,11 @@ test_expect_success 'update-server-info does not crash with -h' '\n \ttest_grep \"[Uu]sage: git update-server-info \" usage\n '\n \n+test_expect_success 'checkout-index does not crash with -h' '\n+\ttest_expect_code 129 git checkout-index -h >usage &&\n+\ttest_grep \"[Uu]sage: git checkout-index \" usage &&\n+\ttest_expect_code 129 nongit git checkout-index -h >usage &&\n+\ttest_grep \"[Uu]sage: git checkout-index \" usage\n+'\n+\n test_done\ndiff --git a/t/t2006-checkout-index-basic.sh b/t/t2006-checkout-index-basic.sh\nindex fedd2cc097..bac231b167 100755\n--- a/t/t2006-checkout-index-basic.sh\n+++ b/t/t2006-checkout-index-basic.sh\n@@ -21,13 +21,6 @@ test_expect_success 'checkout-index -h in broken repository' '\n \ttest_grep \"[Uu]sage\" broken/usage\n '\n \n-test_expect_success 'checkout-index does not crash with -h' '\n-\ttest_expect_code 129 git checkout-index -h >usage &&\n-\ttest_grep \"[Uu]sage: git checkout-index \" usage &&\n-\ttest_expect_code 129 nongit git checkout-index -h >usage &&\n-\ttest_grep \"[Uu]sage: git checkout-index \" usage\n-'\n-\n test_expect_success 'checkout-index reports errors (cmdline)' '\n \ttest_must_fail git checkout-index -- does-not-exist 2>stderr &&\n \ttest_grep not.in.the.cache stderr\n-- \n2.50.0\n\n"},{"id":"521391","messageId":"20250706215039.715732-3-usmanakinyemi202@gmail.com","threadId":"63751","inReplyTo":"20250706215039.715732-1-usmanakinyemi202@gmail.com","subject":"[PATCH v3 2/7] t/t1517: move for-each-ref -h test to t1517","fromName":"Usman Akinyemi","fromEmail":"usmanakinyemi202@gmail.com","sentAt":"2025-07-06T21:50:34Z","receivedAt":"2025-07-06T21:50:52Z","isPatch":true,"sender":{"key":"usmanakinyemi202@gmail.com","avatar":"https://avatars.githubusercontent.com/u/86585626?v=4"},"body":"The test 'for-each-ref does not crash with -h' checks that\nthe command exits cleanly with usage information, both inside and\noutside of a repository.\n\nMove this test from \"t6300-for-each-ref.sh\" to\n\"t1517-outside-repo.sh\" since it better fits with tests that check\ncommand behavior outside a repository.\n\nSuggested-by: Patrick Steinhardt <ps@pks.im>\nSigned-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>\n---\n t/t1517-outside-repo.sh | 7 +++++++\n t/t6300-for-each-ref.sh | 7 -------\n 2 files changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/t/t1517-outside-repo.sh b/t/t1517-outside-repo.sh\nindex 9e54214725..d3487acbfc 100755\n--- a/t/t1517-outside-repo.sh\n+++ b/t/t1517-outside-repo.sh\n@@ -121,4 +121,11 @@ test_expect_success 'checkout-index does not crash with -h' '\n \ttest_grep \"[Uu]sage: git checkout-index \" usage\n '\n \n+test_expect_success 'for-each-ref does not crash with -h' '\n+\ttest_expect_code 129 git for-each-ref -h >usage &&\n+\ttest_grep \"[Uu]sage: git for-each-ref \" usage &&\n+\ttest_expect_code 129 nongit git for-each-ref -h >usage &&\n+\ttest_grep \"[Uu]sage: git for-each-ref \" usage\n+'\n+\n test_done\ndiff --git a/t/t6300-for-each-ref.sh b/t/t6300-for-each-ref.sh\nindex ce9af79ab1..5db7038c41 100755\n--- a/t/t6300-for-each-ref.sh\n+++ b/t/t6300-for-each-ref.sh\n@@ -292,13 +292,6 @@ test_expect_success 'Check invalid atoms names are errors' '\n \ttest_must_fail git for-each-ref --format=\"%(INVALID)\" refs/heads\n '\n \n-test_expect_success 'for-each-ref does not crash with -h' '\n-\ttest_expect_code 129 git for-each-ref -h >usage &&\n-\ttest_grep \"[Uu]sage: git for-each-ref \" usage &&\n-\ttest_expect_code 129 nongit git for-each-ref -h >usage &&\n-\ttest_grep \"[Uu]sage: git for-each-ref \" usage\n-'\n-\n test_expect_success 'Check format specifiers are ignored in naming date atoms' '\n \tgit for-each-ref --format=\"%(authordate)\" refs/heads &&\n \tgit for-each-ref --format=\"%(authordate:default) %(authordate)\" refs/heads &&\n-- \n2.50.0\n\n"},{"id":"521392","messageId":"20250706215039.715732-4-usmanakinyemi202@gmail.com","threadId":"63751","inReplyTo":"20250706215039.715732-1-usmanakinyemi202@gmail.com","subject":"[PATCH v3 3/7] t/t1517: move ls-files -h test to t1517","fromName":"Usman Akinyemi","fromEmail":"usmanakinyemi202@gmail.com","sentAt":"2025-07-06T21:50:35Z","receivedAt":"2025-07-06T21:50:55Z","isPatch":true,"sender":{"key":"usmanakinyemi202@gmail.com","avatar":"https://avatars.githubusercontent.com/u/86585626?v=4"},"body":"The test 'ls-files does not crash with -h' checks that\nthe command exits cleanly with usage information, both inside and\noutside of a repository.\n\nMove this test from \"t3004-ls-files-basic.sh\" to\n\"t1517-outside-repo.sh\" since it better fits with tests that check\ncommand behavior outside a repository.\n\nSuggested-by: Patrick Steinhardt <ps@pks.im>\nSigned-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>\n---\n t/t1517-outside-repo.sh   | 7 +++++++\n t/t3004-ls-files-basic.sh | 7 -------\n 2 files changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/t/t1517-outside-repo.sh b/t/t1517-outside-repo.sh\nindex d3487acbfc..206b9e118c 100755\n--- a/t/t1517-outside-repo.sh\n+++ b/t/t1517-outside-repo.sh\n@@ -128,4 +128,11 @@ test_expect_success 'for-each-ref does not crash with -h' '\n \ttest_grep \"[Uu]sage: git for-each-ref \" usage\n '\n \n+test_expect_success 'ls-files does not crash with -h' '\n+\ttest_expect_code 129 git ls-files -h >usage &&\n+\ttest_grep \"[Uu]sage: git ls-files \" usage &&\n+\ttest_expect_code 129 nongit git ls-files -h >usage &&\n+\ttest_grep \"[Uu]sage: git ls-files \" usage\n+'\n+\n test_done\ndiff --git a/t/t3004-ls-files-basic.sh b/t/t3004-ls-files-basic.sh\nindex 4034a5a59f..a1078f8701 100755\n--- a/t/t3004-ls-files-basic.sh\n+++ b/t/t3004-ls-files-basic.sh\n@@ -34,13 +34,6 @@ test_expect_success 'ls-files -h in corrupt repository' '\n \ttest_grep \"[Uu]sage: git ls-files \" broken/usage\n '\n \n-test_expect_success 'ls-files does not crash with -h' '\n-\ttest_expect_code 129 git ls-files -h >usage &&\n-\ttest_grep \"[Uu]sage: git ls-files \" usage &&\n-\ttest_expect_code 129 nongit git ls-files -h >usage &&\n-\ttest_grep \"[Uu]sage: git ls-files \" usage\n-'\n-\n test_expect_success SYMLINKS 'ls-files with absolute paths to symlinks' '\n \tmkdir subs &&\n \tln -s nosuch link &&\n-- \n2.50.0\n\n"},{"id":"521393","messageId":"20250706215039.715732-5-usmanakinyemi202@gmail.com","threadId":"63751","inReplyTo":"20250706215039.715732-1-usmanakinyemi202@gmail.com","subject":"[PATCH v3 4/7] t/t1517: move pack-refs -h test to t1517","fromName":"Usman Akinyemi","fromEmail":"usmanakinyemi202@gmail.com","sentAt":"2025-07-06T21:50:36Z","receivedAt":"2025-07-06T21:50:58Z","isPatch":true,"sender":{"key":"usmanakinyemi202@gmail.com","avatar":"https://avatars.githubusercontent.com/u/86585626?v=4"},"body":"The test 'pack-refs does not crash with -h' checks that\nthe command exits cleanly with usage information, both inside and\noutside of a repository.\n\nMove this test from \"t0610-reftable-basics.sh\" to\n\"t1517-outside-repo.sh\" since it better fits with tests that check\ncommand behavior outside a repository.\n\nSuggested-by: Patrick Steinhardt <ps@pks.im>\nSigned-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>\n---\n t/t0610-reftable-basics.sh | 7 -------\n t/t1517-outside-repo.sh    | 7 +++++++\n 2 files changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/t/t0610-reftable-basics.sh b/t/t0610-reftable-basics.sh\nindex 3ea5d51532..ffd8ecc0ce 100755\n--- a/t/t0610-reftable-basics.sh\n+++ b/t/t0610-reftable-basics.sh\n@@ -14,13 +14,6 @@ export GIT_TEST_DEFAULT_REF_FORMAT\n \n INVALID_OID=$(test_oid 001)\n \n-test_expect_success 'pack-refs does not crash with -h' '\n-\ttest_expect_code 129 git pack-refs -h >usage &&\n-\ttest_grep \"[Uu]sage: git pack-refs \" usage &&\n-\ttest_expect_code 129 nongit git pack-refs -h >usage &&\n-\ttest_grep \"[Uu]sage: git pack-refs \" usage\n-'\n-\n test_expect_success 'init: creates basic reftable structures' '\n \ttest_when_finished \"rm -rf repo\" &&\n \tgit init repo &&\ndiff --git a/t/t1517-outside-repo.sh b/t/t1517-outside-repo.sh\nindex 206b9e118c..39e7842c9e 100755\n--- a/t/t1517-outside-repo.sh\n+++ b/t/t1517-outside-repo.sh\n@@ -135,4 +135,11 @@ test_expect_success 'ls-files does not crash with -h' '\n \ttest_grep \"[Uu]sage: git ls-files \" usage\n '\n \n+test_expect_success 'pack-refs does not crash with -h' '\n+\ttest_expect_code 129 git pack-refs -h >usage &&\n+\ttest_grep \"[Uu]sage: git pack-refs \" usage &&\n+\ttest_expect_code 129 nongit git pack-refs -h >usage &&\n+\ttest_grep \"[Uu]sage: git pack-refs \" usage\n+'\n+\n test_done\n-- \n2.50.0\n\n"},{"id":"521394","messageId":"20250706215039.715732-6-usmanakinyemi202@gmail.com","threadId":"63751","inReplyTo":"20250706215039.715732-1-usmanakinyemi202@gmail.com","subject":"[PATCH v3 5/7] t/t1517: move send-pack -h test to t1517","fromName":"Usman Akinyemi","fromEmail":"usmanakinyemi202@gmail.com","sentAt":"2025-07-06T21:50:37Z","receivedAt":"2025-07-06T21:51:01Z","isPatch":true,"sender":{"key":"usmanakinyemi202@gmail.com","avatar":"https://avatars.githubusercontent.com/u/86585626?v=4"},"body":"The test 'send-pack does not crash with -h' checks that\nthe command exits cleanly with usage information, both inside and\noutside of a repository.\n\nMove this test from \"t/t5400-send-pack.sh\" to\n\"t1517-outside-repo.sh\" since it better fits with tests that check\ncommand behavior outside a repository.\n\nSuggested-by: Patrick Steinhardt <ps@pks.im>\nSigned-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>\n---\n t/t1517-outside-repo.sh | 7 +++++++\n t/t5400-send-pack.sh    | 7 -------\n 2 files changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/t/t1517-outside-repo.sh b/t/t1517-outside-repo.sh\nindex 39e7842c9e..2568f8ae0d 100755\n--- a/t/t1517-outside-repo.sh\n+++ b/t/t1517-outside-repo.sh\n@@ -142,4 +142,11 @@ test_expect_success 'pack-refs does not crash with -h' '\n \ttest_grep \"[Uu]sage: git pack-refs \" usage\n '\n \n+test_expect_success 'send-pack does not crash with -h' '\n+\ttest_expect_code 129 git send-pack -h >usage &&\n+\ttest_grep \"[Uu]sage: git send-pack \" usage &&\n+\ttest_expect_code 129 nongit git send-pack -h >usage &&\n+\ttest_grep \"[Uu]sage: git send-pack \" usage\n+'\n+\n test_done\ndiff --git a/t/t5400-send-pack.sh b/t/t5400-send-pack.sh\nindex 83b42ff073..571e8f1bc5 100755\n--- a/t/t5400-send-pack.sh\n+++ b/t/t5400-send-pack.sh\n@@ -55,13 +55,6 @@ test_expect_success setup '\n \techo Rebase &&\n \tgit log'\n \n-test_expect_success 'send-pack does not crash with -h' '\n-\ttest_expect_code 129 git send-pack -h >usage &&\n-\ttest_grep \"[Uu]sage: git send-pack \" usage &&\n-\ttest_expect_code 129 nongit git send-pack -h >usage &&\n-\ttest_grep \"[Uu]sage: git send-pack \" usage\n-'\n-\n test_expect_success 'pack the source repository' '\n \tgit repack -a -d &&\n \tgit prune\n-- \n2.50.0\n\n"},{"id":"521395","messageId":"20250706215039.715732-7-usmanakinyemi202@gmail.com","threadId":"63751","inReplyTo":"20250706215039.715732-1-usmanakinyemi202@gmail.com","subject":"[PATCH v3 6/7] t/t1517: move verify-commit -h test to t1517","fromName":"Usman Akinyemi","fromEmail":"usmanakinyemi202@gmail.com","sentAt":"2025-07-06T21:50:38Z","receivedAt":"2025-07-06T21:51:04Z","isPatch":true,"sender":{"key":"usmanakinyemi202@gmail.com","avatar":"https://avatars.githubusercontent.com/u/86585626?v=4"},"body":"The test 'verify-commit does not crash with -h' checks that\nthe command exits cleanly with usage information, both inside and\noutside of a repository.\n\nMove this test from \"t/t7510-signed-commit.sh\" to\n\"t1517-outside-repo.sh\" since it better fits with tests that check\ncommand behavior outside a repository.\n\nSuggested-by: Patrick Steinhardt <ps@pks.im>\nSigned-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>\n---\n t/t1517-outside-repo.sh  | 7 +++++++\n t/t7510-signed-commit.sh | 7 -------\n 2 files changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/t/t1517-outside-repo.sh b/t/t1517-outside-repo.sh\nindex 2568f8ae0d..8a46fdfdd1 100755\n--- a/t/t1517-outside-repo.sh\n+++ b/t/t1517-outside-repo.sh\n@@ -149,4 +149,11 @@ test_expect_success 'send-pack does not crash with -h' '\n \ttest_grep \"[Uu]sage: git send-pack \" usage\n '\n \n+test_expect_success 'verify-commit does not crash with -h' '\n+\ttest_expect_code 129 git verify-commit -h >usage &&\n+\ttest_grep \"[Uu]sage: git verify-commit \" usage &&\n+\ttest_expect_code 129 nongit git verify-commit -h >usage &&\n+\ttest_grep \"[Uu]sage: git verify-commit \" usage\n+'\n+\n test_done\ndiff --git a/t/t7510-signed-commit.sh b/t/t7510-signed-commit.sh\nindex 39677e859a..0d2dd29fe6 100755\n--- a/t/t7510-signed-commit.sh\n+++ b/t/t7510-signed-commit.sh\n@@ -8,13 +8,6 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n GNUPGHOME_NOT_USED=$GNUPGHOME\n . \"$TEST_DIRECTORY/lib-gpg.sh\"\n \n-test_expect_success GPG 'verify-commit does not crash with -h' '\n-\ttest_expect_code 129 git verify-commit -h >usage &&\n-\ttest_grep \"[Uu]sage: git verify-commit \" usage &&\n-\ttest_expect_code 129 nongit git verify-commit -h >usage &&\n-\ttest_grep \"[Uu]sage: git verify-commit \" usage\n-'\n-\n test_expect_success GPG 'create signed commits' '\n \ttest_oid_cache <<-\\EOF &&\n \theader sha1:gpgsig\n-- \n2.50.0\n\n"},{"id":"521396","messageId":"20250706215039.715732-8-usmanakinyemi202@gmail.com","threadId":"63751","inReplyTo":"20250706215039.715732-1-usmanakinyemi202@gmail.com","subject":"[PATCH v3 7/7] t/t1517: move verify-tag -h test to t1517","fromName":"Usman Akinyemi","fromEmail":"usmanakinyemi202@gmail.com","sentAt":"2025-07-06T21:50:39Z","receivedAt":"2025-07-06T21:51:07Z","isPatch":true,"sender":{"key":"usmanakinyemi202@gmail.com","avatar":"https://avatars.githubusercontent.com/u/86585626?v=4"},"body":"The test 'verify-tag does not crash with -h' checks that\nthe command exits cleanly with usage information, both inside and\noutside of a repository.\n\nMove this test from \"t/t7030-verify-tag.sh\" to\n\"t1517-outside-repo.sh\" since it better fits with tests that check\ncommand behavior outside a repository.\n\nSuggested-by: Patrick Steinhardt <ps@pks.im>\nSigned-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>\n---\n t/t1517-outside-repo.sh | 7 +++++++\n t/t7030-verify-tag.sh   | 7 -------\n 2 files changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/t/t1517-outside-repo.sh b/t/t1517-outside-repo.sh\nindex 8a46fdfdd1..25ec3b3978 100755\n--- a/t/t1517-outside-repo.sh\n+++ b/t/t1517-outside-repo.sh\n@@ -156,4 +156,11 @@ test_expect_success 'verify-commit does not crash with -h' '\n \ttest_grep \"[Uu]sage: git verify-commit \" usage\n '\n \n+test_expect_success 'verify-tag does not crash with -h' '\n+\ttest_expect_code 129 git verify-tag -h >usage &&\n+\ttest_grep \"[Uu]sage: git verify-tag \" usage &&\n+\ttest_expect_code 129 nongit git verify-tag -h >usage &&\n+\ttest_grep \"[Uu]sage: git verify-tag \" usage\n+'\n+\n test_done\ndiff --git a/t/t7030-verify-tag.sh b/t/t7030-verify-tag.sh\nindex 2c147072c1..6f526c37c2 100755\n--- a/t/t7030-verify-tag.sh\n+++ b/t/t7030-verify-tag.sh\n@@ -7,13 +7,6 @@ export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\n . ./test-lib.sh\n . \"$TEST_DIRECTORY/lib-gpg.sh\"\n \n-test_expect_success GPG 'verify-tag does not crash with -h' '\n-\ttest_expect_code 129 git verify-tag -h >usage &&\n-\ttest_grep \"[Uu]sage: git verify-tag \" usage &&\n-\ttest_expect_code 129 nongit git verify-tag -h >usage &&\n-\ttest_grep \"[Uu]sage: git verify-tag \" usage\n-'\n-\n test_expect_success GPG 'create signed tags' '\n \techo 1 >file && git add file &&\n \ttest_tick && git commit -m initial &&\n-- \n2.50.0\n\n"},{"id":"521447","messageId":"xmqqtt3o3rqm.fsf@gitster.g","threadId":"63751","inReplyTo":"20250706215039.715732-7-usmanakinyemi202@gmail.com","subject":"Re: [PATCH v3 6/7] t/t1517: move verify-commit -h test to t1517","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-07-07T16:12:01Z","receivedAt":"2025-07-07T16:12:04Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Usman Akinyemi <usmanakinyemi202@gmail.com> writes:\n\n> The test 'verify-commit does not crash with -h' checks that\n> the command exits cleanly with usage information, both inside and\n> outside of a repository.\n>\n> Move this test from \"t/t7510-signed-commit.sh\" to\n> \"t1517-outside-repo.sh\" since it better fits with tests that check\n> command behavior outside a repository.\n>\n> Suggested-by: Patrick Steinhardt <ps@pks.im>\n> Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>\n> ---\n>  t/t1517-outside-repo.sh  | 7 +++++++\n>  t/t7510-signed-commit.sh | 7 -------\n>  2 files changed, 7 insertions(+), 7 deletions(-)\n\nMy first reaction to this series was \"heh, you can cut it both ways;\na test to see how a command A works outside a repository can be a\ntest about command A (which is the way how the current test suite\nlooks at) or a test about being outside a repository (which this\ntopic tries to move into).\n\nBut this may be an example that shows why it is more error prone to\npartition across \"inside? outside?\" axis.  These particular ones may\nbe limited to \"should exit without crashing and without doing\nanything fancy when asked to give a short help\", so this move may\nhappen to be able to lose the GPG prerequisite without breaking\nanything.\n\nBut in the longer run, we are very much likely that we'd want to\ntest something that needs things that require prerequisites (like\n\"do this only where XYZ is installed\") but ought to work outside a\nrepository, which means t1517 would need to pull in things like\nlib-gpg.sh only because it has a few tests about verify-blah\ncommand.  These tend to accumulate over time.\n\nSo, I dunno.\n\n"},{"id":"521792","messageId":"CAPSxiM_ZZrbFpgvxqYgZ8oeTbRs+HW=rM+9Dud0G_Qr7eq3=FA@mail.gmail.com","threadId":"63751","inReplyTo":"xmqqtt3o3rqm.fsf@gitster.g","subject":"Re: [PATCH v3 6/7] t/t1517: move verify-commit -h test to t1517","fromName":"Usman Akinyemi","fromEmail":"usmanakinyemi202@gmail.com","sentAt":"2025-07-10T22:59:30Z","receivedAt":"2025-07-10T22:59:42Z","isPatch":true,"sender":{"key":"usmanakinyemi202@gmail.com","avatar":"https://avatars.githubusercontent.com/u/86585626?v=4"},"body":"On Mon, Jul 7, 2025 at 9:42 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Usman Akinyemi <usmanakinyemi202@gmail.com> writes:\n>\n> > The test 'verify-commit does not crash with -h' checks that\n> > the command exits cleanly with usage information, both inside and\n> > outside of a repository.\n> >\n> > Move this test from \"t/t7510-signed-commit.sh\" to\n> > \"t1517-outside-repo.sh\" since it better fits with tests that check\n> > command behavior outside a repository.\n> >\n> > Suggested-by: Patrick Steinhardt <ps@pks.im>\n> > Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>\n> > ---\n> >  t/t1517-outside-repo.sh  | 7 +++++++\n> >  t/t7510-signed-commit.sh | 7 -------\n> >  2 files changed, 7 insertions(+), 7 deletions(-)\n>\nHi Junio,\n> My first reaction to this series was \"heh, you can cut it both ways;\n> a test to see how a command A works outside a repository can be a\n> test about command A (which is the way how the current test suite\n> looks at) or a test about being outside a repository (which this\n> topic tries to move into).\n>\nActually, I felt the same while trying to create the patch series. I was\ngoing to just send a single patch before as an RFC.\n\n> But this may be an example that shows why it is more error prone to\n> partition across \"inside? outside?\" axis.  These particular ones may\n> be limited to \"should exit without crashing and without doing\n> anything fancy when asked to give a short help\", so this move may\n> happen to be able to lose the GPG prerequisite without breaking\n> anything.\n>\n> But in the longer run, we are very much likely that we'd want to\n> test something that needs things that require prerequisites (like\n> \"do this only where XYZ is installed\") but ought to work outside a\n> repository, which means t1517 would need to pull in things like\n> lib-gpg.sh only because it has a few tests about verify-blah\n> command.  These tend to accumulate over time.\n\nI understand the concern and I felt we should at least decide where to\nput the \"verify -h\" because, right now, we have some of them in the\nt1517 and also some in their respective test files. So, there are some\nlittle hiccups there. It will also create a headache for someone who is trying\nto place the test(deciding if they should put it in the t1517 as some\ntest or inside\ntheir respective test as some others). Also, Ayush(GSoC) is also\nworking currently around this\npart.\n\nIs it something that is worth creating a new test file for, I will\nprobably say that is a viable solution or better still we should put\nthe test inside their respective test files.\n\nWhat do you think ?\n>\n> So, I dunno.\n>\n"},{"id":"521831","messageId":"xmqqcya63cqx.fsf@gitster.g","threadId":"63751","inReplyTo":"CAPSxiM_ZZrbFpgvxqYgZ8oeTbRs+HW=rM+9Dud0G_Qr7eq3=FA@mail.gmail.com","subject":"Re: [PATCH v3 6/7] t/t1517: move verify-commit -h test to t1517","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-07-11T16:37:10Z","receivedAt":"2025-07-11T16:37:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Usman Akinyemi <usmanakinyemi202@gmail.com> writes:\n\n>> But in the longer run, we are very much likely that we'd want to\n>> test something that needs things that require prerequisites (like\n>> \"do this only where XYZ is installed\") but ought to work outside a\n>> repository, which means t1517 would need to pull in things like\n>> lib-gpg.sh only because it has a few tests about verify-blah\n>> command.  These tend to accumulate over time.\n>\n> I understand the concern and I felt we should at least decide where to\n> put the \"verify -h\" because, right now, we have some of them in the\n> t1517 and also some in their respective test files.\n\nIf t1517 were only about \"git subcmd -h outside a repository\" for\nvarious subcommands, that would be a happy arrangement.  I think we\neven have a way to iterate over all Git subcommands, current or\nfuture, so your patch may become \"we've sprinkled 'subcmd -h' tests\nin various scripts, but now t1517 will do that automatically so\nanybody who add a new command do not have to do anything\".\n\nBut if t1517 currently (before your series) already has other things\ntested, that changes the story somewhat.  Especially if we aim for\nthe automated solution, we may want to move existing tests in 1517\nthat is not about \"subcmd -h\" out to different scripts.  Obvious\ntwo choices are:\n\n - We spread them to existing test scripts for the command being\n   tested (e.g. \"does patch-id work correctly outside a repo?\"\n   moves to t4204-patch-id, and \"does update-server-info work OK\n   inside and outside a repo?\" can be split and one half moves to\n   t5200-update-server-info).\n\n - We move them all to a new test script that is dedicated for \"do\n   various subcommands work outside a repo to do things other than\n   responding to '-h'?\".\n\nand I would favour the former.\n\nThe only reason why you moved these to t1517 is because the set-up\npart of that script sets up the ceiling just once properly and let\nits tests do as if they are running outsie a repository, and having\nto arrange the ceiling correctly to add a few test in various\nscripts so that each of these scripts can test their single\nsubcommand pretending that it is running outside a repository looked\ncumbersome, right?  And I do agree with you, if that was the reason,\nthat it is annoying to have to set up the ceiling manually in each\ntest script.  But then can we do it less annoying?  We already made\na nongit test helper and it may be good enough to help existing\ntests in t1517.\n\nAs an illustration, here is what the beginning of the former\napproach may look like.\n\n\n t/t1517-outside-repo.sh       | 27 +++++++++++++++++++++------\n t/t5200-update-server-info.sh |  5 +++++\n 2 files changed, 26 insertions(+), 6 deletions(-)\n\ndiff --git c/t/t1517-outside-repo.sh w/t/t1517-outside-repo.sh\nindex 6824581317..c1294d5761 100755\n--- c/t/t1517-outside-repo.sh\n+++ w/t/t1517-outside-repo.sh\n@@ -107,11 +107,26 @@ test_expect_success LIBCURL 'remote-http outside repository' '\n \ttest_grep \"^error: remote-curl\" actual\n '\n \n-test_expect_success 'update-server-info does not crash with -h' '\n-\ttest_expect_code 129 git update-server-info -h >usage &&\n-\ttest_grep \"[Uu]sage: git update-server-info \" usage &&\n-\ttest_expect_code 129 nongit git update-server-info -h >usage &&\n-\ttest_grep \"[Uu]sage: git update-server-info \" usage\n-'\n+for cmd in $(git --list-cmds=main)\n+do\n+\tcmd=${cmd%.*} # strip .sh, .perl, etc.\n+\tcase \"$cmd\" in\n+\tarchimport | cvsexportcommit | cvsimport | cvsserver | daemon | \\\n+\tdifftool--helper | filter-branch | fsck-objects | get-tar-commit-id | \\\n+\thttp-backend | http-fetch | http-push | init-db | instaweb.sh | \\\n+\tmerge-octopus | merge-one-file | merge-resolve | mergetool | \\\n+\tmktag | p4 | p4.py | pickaxe | quiltimport | remote-ftp | remote-ftps | \\\n+\tremote-http | remote-https | replay | request-pull | send-email | \\\n+\tsh-i18n--envsubst | shell | show | stage | submodule | svn | \\\n+\tupload-archive--writer | upload-pack | web--browse | whatchanged)\n+\t\texpect_outcome=expect_failure ;;\n+\t*)\n+\t\texpect_outcome=expect_success ;;\n+\tesac\n+\ttest_$expect_outcome \"'git $cmd -h' outside a repository\" '\n+\t\ttest_expect_code 129 nongit git $cmd -h >usage &&\n+\t\ttest_grep \"[Uu]sage: git $cmd \" usage\n+\t'\n+done\n \n test_done\ndiff --git c/t/t5200-update-server-info.sh w/t/t5200-update-server-info.sh\nindex 8365907055..a551e955b5 100755\n--- c/t/t5200-update-server-info.sh\n+++ w/t/t5200-update-server-info.sh\n@@ -46,4 +46,9 @@ test_expect_success 'midx does not create duplicate pack entries' '\n \ttest_must_be_empty dups\n '\n \n+test_expect_success 'update-server-info does not crash with -h' '\n+\ttest_expect_code 129 git update-server-info -h >usage &&\n+\ttest_grep \"[Uu]sage: git update-server-info \" usage\n+'\n+\n test_done\n"},{"id":"522345","messageId":"20250721115519.140361-1-usmanakinyemi202@gmail.com","threadId":"63751","inReplyTo":"xmqqcya63cqx.fsf@gitster.g","subject":"[PATCH v4 0/2] refactor t1517 to focus on help output outside a repository","fromName":"Usman Akinyemi","fromEmail":"usmanakinyemi202@gmail.com","sentAt":"2025-07-21T11:55:17Z","receivedAt":"2025-07-21T11:55:26Z","isPatch":true,"sender":{"key":"usmanakinyemi202@gmail.com","avatar":"https://avatars.githubusercontent.com/u/86585626?v=4"},"body":"This series refactors t1517-outside-repo.sh to focus on testing\n`git subcmd -h` outside a Git repository. It does two things:\n\n  1. Moves the existing `update-server-info -h` test to t5200, since it\n     tests behavior *inside* a repo and belongs with other update-server-info\n     tests.\n  \n  2. Introduces a loop in t1517 that automatically verifies `-h` output\n     for all main Git subcommands when run outside a repository, using\n     the `nongit` helper and `git --list-cmds=main`.\n\nThis makes t1517 easier to maintain and ensures that new commands are\nautomatically covered for this class of behavior.\n\n\nChanges since v3:\n  - Changes the approach from having the t1517 to test\n  both help outside and inside repo to just having inside repo.\n\nUsman Akinyemi (2):\n  t/t1517: automate `git subcmd -h` tests outside a repository\n  t5200: move `update-server-info -h` test from t1517\n\n t/t1517-outside-repo.sh       | 28 ++++++++++++++++++++++------\n t/t5200-update-server-info.sh |  5 +++++\n 2 files changed, 27 insertions(+), 6 deletions(-)\n\n-- \n2.50.0\n\n"},{"id":"522346","messageId":"20250721115519.140361-2-usmanakinyemi202@gmail.com","threadId":"63751","inReplyTo":"20250721115519.140361-1-usmanakinyemi202@gmail.com","subject":"[PATCH v4 1/2] t/t1517: automate `git subcmd -h` tests outside a repository","fromName":"Usman Akinyemi","fromEmail":"usmanakinyemi202@gmail.com","sentAt":"2025-07-21T11:55:18Z","receivedAt":"2025-07-21T11:55:29Z","isPatch":true,"sender":{"key":"usmanakinyemi202@gmail.com","avatar":"https://avatars.githubusercontent.com/u/86585626?v=4"},"body":"Replace manual `-h` tests with a loop over all subcommands using\n`git --list-cmds=main`. This ensures consistent coverage of `-h`\nbehavior outside a repo and future-proofs the test by covering\nnew commands automatically.\n\nKnown exceptions are skipped or marked as expected failures.\n\nSuggested-by: Patrick Steinhardt <ps@pks.im>\nHelped-by: Junio C Hamano <gitster@pobox.com>\nSigned-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>\n---\n t/t1517-outside-repo.sh | 25 +++++++++++++++++++++++--\n 1 file changed, 23 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t1517-outside-repo.sh b/t/t1517-outside-repo.sh\nindex 6824581317..9fcebb7d94 100755\n--- a/t/t1517-outside-repo.sh\n+++ b/t/t1517-outside-repo.sh\n@@ -110,8 +110,29 @@ test_expect_success LIBCURL 'remote-http outside repository' '\n test_expect_success 'update-server-info does not crash with -h' '\n \ttest_expect_code 129 git update-server-info -h >usage &&\n \ttest_grep \"[Uu]sage: git update-server-info \" usage &&\n-\ttest_expect_code 129 nongit git update-server-info -h >usage &&\n-\ttest_grep \"[Uu]sage: git update-server-info \" usage\n '\n \n+for cmd in $(git --list-cmds=main)\n+do\n+\tcmd=${cmd%.*} # strip .sh, .perl, etc.\n+\tcase \"$cmd\" in\n+\tarchimport | cvsexportcommit | cvsimport | cvsserver | daemon | \\\n+\tdifftool--helper | filter-branch | fsck-objects | get-tar-commit-id | \\\n+\thttp-backend | http-fetch | http-push | init-db | instaweb.sh | \\\n+\tmerge-octopus | merge-one-file | merge-resolve | mergetool | \\\n+\tmktag | p4 | p4.py | pickaxe | quiltimport | remote-ftp | remote-ftps | \\\n+\tremote-http | remote-https | replay | request-pull | send-email | \\\n+\tsh-i18n--envsubst | shell | show | stage | submodule | svn | \\\n+\tupload-archive--writer | upload-pack | web--browse | whatchanged)\n+\t\texpect_outcome=expect_failure ;;\n+\t*)\n+\t\texpect_outcome=expect_success ;;\n+\tesac\n+\ttest_$expect_outcome \"'git $cmd -h' outside a repository\" '\n+\t\ttest_expect_code 129 nongit git $cmd -h >usage &&\n+\t\techo \"Hello\" &&\n+\t\ttest_grep \"[Uu]sage: git $cmd \" usage\n+\t'\n+done\n+\n test_done\n-- \n2.50.0\n\n"},{"id":"522347","messageId":"20250721115519.140361-3-usmanakinyemi202@gmail.com","threadId":"63751","inReplyTo":"20250721115519.140361-1-usmanakinyemi202@gmail.com","subject":"[PATCH v4 2/2] t5200: move `update-server-info -h` test from t1517","fromName":"Usman Akinyemi","fromEmail":"usmanakinyemi202@gmail.com","sentAt":"2025-07-21T11:55:19Z","receivedAt":"2025-07-21T11:55:32Z","isPatch":true,"sender":{"key":"usmanakinyemi202@gmail.com","avatar":"https://avatars.githubusercontent.com/u/86585626?v=4"},"body":"t1517 is now focused on testing subcommands outside a repository.\nMove the in-repo `-h` test for `update-server-info` to t5200,\nwhich covers this command.\n\nSuggested-by: Patrick Steinhardt <ps@pks.im>\nHelped-by: Junio C Hamano <gitster@pobox.com>\nSigned-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>\n---\n t/t1517-outside-repo.sh       | 5 -----\n t/t5200-update-server-info.sh | 5 +++++\n 2 files changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/t/t1517-outside-repo.sh b/t/t1517-outside-repo.sh\nindex 9fcebb7d94..a1c644dffa 100755\n--- a/t/t1517-outside-repo.sh\n+++ b/t/t1517-outside-repo.sh\n@@ -107,11 +107,6 @@ test_expect_success LIBCURL 'remote-http outside repository' '\n \ttest_grep \"^error: remote-curl\" actual\n '\n \n-test_expect_success 'update-server-info does not crash with -h' '\n-\ttest_expect_code 129 git update-server-info -h >usage &&\n-\ttest_grep \"[Uu]sage: git update-server-info \" usage &&\n-'\n-\n for cmd in $(git --list-cmds=main)\n do\n \tcmd=${cmd%.*} # strip .sh, .perl, etc.\ndiff --git a/t/t5200-update-server-info.sh b/t/t5200-update-server-info.sh\nindex 8365907055..a1f129db4e 100755\n--- a/t/t5200-update-server-info.sh\n+++ b/t/t5200-update-server-info.sh\n@@ -46,4 +46,9 @@ test_expect_success 'midx does not create duplicate pack entries' '\n \ttest_must_be_empty dups\n '\n \n+test_expect_success 'update-server-info does not crash with -h' '\n+\ttest_expect_code 129 git update-server-info -h >usage &&\n+\ttest_grep \"[Uu]sage: git update-server-info \" usage &&\n+'\n+\n test_done\n-- \n2.50.0\n\n"},{"id":"522794","messageId":"CALnO6CCN0HUXJVYmvAJO3EoQQZzHVjE0P=g+AUc9c5Ti0Rcm2w@mail.gmail.com","threadId":"63751","inReplyTo":"20250721115519.140361-2-usmanakinyemi202@gmail.com","subject":"Re: [PATCH v4 1/2] t/t1517: automate `git subcmd -h` tests outside a repository","fromName":"D. Ben Knoble","fromEmail":"ben.knoble@gmail.com","sentAt":"2025-07-26T14:34:37Z","receivedAt":"2025-07-26T14:34:50Z","isPatch":true,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"On Mon, Jul 21, 2025 at 7:55 AM Usman Akinyemi\n<usmanakinyemi202@gmail.com> wrote:\n>\n> Replace manual `-h` tests with a loop over all subcommands using\n> `git --list-cmds=main`. This ensures consistent coverage of `-h`\n> behavior outside a repo and future-proofs the test by covering\n> new commands automatically.\n>\n> Known exceptions are skipped or marked as expected failures.\n>\n> Suggested-by: Patrick Steinhardt <ps@pks.im>\n> Helped-by: Junio C Hamano <gitster@pobox.com>\n> Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>\n> ---\n>  t/t1517-outside-repo.sh | 25 +++++++++++++++++++++++--\n>  1 file changed, 23 insertions(+), 2 deletions(-)\n>\n> diff --git a/t/t1517-outside-repo.sh b/t/t1517-outside-repo.sh\n> index 6824581317..9fcebb7d94 100755\n> --- a/t/t1517-outside-repo.sh\n> +++ b/t/t1517-outside-repo.sh\n> @@ -110,8 +110,29 @@ test_expect_success LIBCURL 'remote-http outside repository' '\n>  test_expect_success 'update-server-info does not crash with -h' '\n>         test_expect_code 129 git update-server-info -h >usage &&\n>         test_grep \"[Uu]sage: git update-server-info \" usage &&\n> -       test_expect_code 129 nongit git update-server-info -h >usage &&\n> -       test_grep \"[Uu]sage: git update-server-info \" usage\n>  '\n>\n> +for cmd in $(git --list-cmds=main)\n> +do\n> +       cmd=${cmd%.*} # strip .sh, .perl, etc.\n> +       case \"$cmd\" in\n> +       archimport | cvsexportcommit | cvsimport | cvsserver | daemon | \\\n> +       difftool--helper | filter-branch | fsck-objects | get-tar-commit-id | \\\n> +       http-backend | http-fetch | http-push | init-db | instaweb.sh | \\\n> +       merge-octopus | merge-one-file | merge-resolve | mergetool | \\\n> +       mktag | p4 | p4.py | pickaxe | quiltimport | remote-ftp | remote-ftps | \\\n\nHm—if we strip the suffix with ${cmd%.*}, do we need a p4.py pattern\ntoo? Actually, at first I wondered why we need to strip the suffix at\nall. My local Git produces only unsuffixed commands. But\nbin-wrappers/git produces both p4 and p4.py; request-pull and\nrequest-pull.sh; and several others. So I think stripping is probably\nright, just drop the .py pattern.\n\n> +       remote-http | remote-https | replay | request-pull | send-email | \\\n> +       sh-i18n--envsubst | shell | show | stage | submodule | svn | \\\n> +       upload-archive--writer | upload-pack | web--browse | whatchanged)\n> +               expect_outcome=expect_failure ;;\n> +       *)\n> +               expect_outcome=expect_success ;;\n> +       esac\n> +       test_$expect_outcome \"'git $cmd -h' outside a repository\" '\n> +               test_expect_code 129 nongit git $cmd -h >usage &&\n> +               echo \"Hello\" &&\n\nWoops! While basing some work on this branch, I spotted this \"echo\"—I\nassume it's leftover and didn't mean to be included here? Will drop\nlocally for my own work.\n\n> +               test_grep \"[Uu]sage: git $cmd \" usage\n> +       '\n> +done\n> +\n>  test_done\n> --\n> 2.50.0\n>\n>\n\nLast thing: outside the patch context, there's a test for prune that\nshould probably get tweaked like the update-server-info test.\n\n\n-- \nD. Ben Knoble\n"},{"id":"522795","messageId":"CALnO6CCFXfPDZKzx1SBufwzkBJchZr0XYigo_8AQ_U=MuJa7xg@mail.gmail.com","threadId":"63751","inReplyTo":"20250721115519.140361-2-usmanakinyemi202@gmail.com","subject":"Re: [PATCH v4 1/2] t/t1517: automate `git subcmd -h` tests outside a repository","fromName":"D. Ben Knoble","fromEmail":"ben.knoble@gmail.com","sentAt":"2025-07-26T14:37:33Z","receivedAt":"2025-07-26T14:37:47Z","isPatch":true,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"On Mon, Jul 21, 2025 at 7:55 AM Usman Akinyemi\n<usmanakinyemi202@gmail.com> wrote:\n>\n> Replace manual `-h` tests with a loop over all subcommands using\n> `git --list-cmds=main`. This ensures consistent coverage of `-h`\n> behavior outside a repo and future-proofs the test by covering\n> new commands automatically.\n>\n> Known exceptions are skipped or marked as expected failures.\n>\n> Suggested-by: Patrick Steinhardt <ps@pks.im>\n> Helped-by: Junio C Hamano <gitster@pobox.com>\n> Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>\n> ---\n>  t/t1517-outside-repo.sh | 25 +++++++++++++++++++++++--\n>  1 file changed, 23 insertions(+), 2 deletions(-)\n>\n> diff --git a/t/t1517-outside-repo.sh b/t/t1517-outside-repo.sh\n> index 6824581317..9fcebb7d94 100755\n> --- a/t/t1517-outside-repo.sh\n> +++ b/t/t1517-outside-repo.sh\n> @@ -110,8 +110,29 @@ test_expect_success LIBCURL 'remote-http outside repository' '\n>  test_expect_success 'update-server-info does not crash with -h' '\n>         test_expect_code 129 git update-server-info -h >usage &&\n>         test_grep \"[Uu]sage: git update-server-info \" usage &&\n> -       test_expect_code 129 nongit git update-server-info -h >usage &&\n> -       test_grep \"[Uu]sage: git update-server-info \" usage\n>  '\n>\n> +for cmd in $(git --list-cmds=main)\n> +do\n> +       cmd=${cmd%.*} # strip .sh, .perl, etc.\n> +       case \"$cmd\" in\n> +       archimport | cvsexportcommit | cvsimport | cvsserver | daemon | \\\n> +       difftool--helper | filter-branch | fsck-objects | get-tar-commit-id | \\\n> +       http-backend | http-fetch | http-push | init-db | instaweb.sh | \\\n> +       merge-octopus | merge-one-file | merge-resolve | mergetool | \\\n> +       mktag | p4 | p4.py | pickaxe | quiltimport | remote-ftp | remote-ftps | \\\n> +       remote-http | remote-https | replay | request-pull | send-email | \\\n> +       sh-i18n--envsubst | shell | show | stage | submodule | svn | \\\n> +       upload-archive--writer | upload-pack | web--browse | whatchanged)\n\nSorry, one more thing: I spot-checked a few of these, and it seems the\nmain issue that causes failures is the exit code; they seem to work\nwith \"-h\" outside a repo. Out of scope for this series, but something\nworth tidying up as #leftoverbits ?\n\n> +               expect_outcome=expect_failure ;;\n> +       *)\n> +               expect_outcome=expect_success ;;\n> +       esac\n> +       test_$expect_outcome \"'git $cmd -h' outside a repository\" '\n> +               test_expect_code 129 nongit git $cmd -h >usage &&\n> +               echo \"Hello\" &&\n> +               test_grep \"[Uu]sage: git $cmd \" usage\n> +       '\n> +done\n> +\n>  test_done\n> --\n> 2.50.0\n>\n>\n\n\n-- \nD. Ben Knoble\n"},{"id":"522796","messageId":"CALnO6CCxTQYnVmdjeDnCyr=9i9S-uP9QbF9X0dUTfeJ4mcX4ig@mail.gmail.com","threadId":"63751","inReplyTo":"CALnO6CCFXfPDZKzx1SBufwzkBJchZr0XYigo_8AQ_U=MuJa7xg@mail.gmail.com","subject":"Re: [PATCH v4 1/2] t/t1517: automate `git subcmd -h` tests outside a repository","fromName":"D. Ben Knoble","fromEmail":"ben.knoble@gmail.com","sentAt":"2025-07-26T14:52:00Z","receivedAt":"2025-07-26T14:52:13Z","isPatch":true,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"On Sat, Jul 26, 2025 at 10:37 AM D. Ben Knoble <ben.knoble@gmail.com> wrote:\n>\n> On Mon, Jul 21, 2025 at 7:55 AM Usman Akinyemi\n> <usmanakinyemi202@gmail.com> wrote:\n> >\n> > Replace manual `-h` tests with a loop over all subcommands using\n> > `git --list-cmds=main`. This ensures consistent coverage of `-h`\n> > behavior outside a repo and future-proofs the test by covering\n> > new commands automatically.\n> >\n> > Known exceptions are skipped or marked as expected failures.\n> >\n> > Suggested-by: Patrick Steinhardt <ps@pks.im>\n> > Helped-by: Junio C Hamano <gitster@pobox.com>\n> > Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>\n> > ---\n> >  t/t1517-outside-repo.sh | 25 +++++++++++++++++++++++--\n> >  1 file changed, 23 insertions(+), 2 deletions(-)\n> >\n> > diff --git a/t/t1517-outside-repo.sh b/t/t1517-outside-repo.sh\n> > index 6824581317..9fcebb7d94 100755\n> > --- a/t/t1517-outside-repo.sh\n> > +++ b/t/t1517-outside-repo.sh\n> > @@ -110,8 +110,29 @@ test_expect_success LIBCURL 'remote-http outside repository' '\n> >  test_expect_success 'update-server-info does not crash with -h' '\n> >         test_expect_code 129 git update-server-info -h >usage &&\n> >         test_grep \"[Uu]sage: git update-server-info \" usage &&\n> > -       test_expect_code 129 nongit git update-server-info -h >usage &&\n> > -       test_grep \"[Uu]sage: git update-server-info \" usage\n> >  '\n> >\n> > +for cmd in $(git --list-cmds=main)\n> > +do\n> > +       cmd=${cmd%.*} # strip .sh, .perl, etc.\n> > +       case \"$cmd\" in\n> > +       archimport | cvsexportcommit | cvsimport | cvsserver | daemon | \\\n> > +       difftool--helper | filter-branch | fsck-objects | get-tar-commit-id | \\\n> > +       http-backend | http-fetch | http-push | init-db | instaweb.sh | \\\n> > +       merge-octopus | merge-one-file | merge-resolve | mergetool | \\\n> > +       mktag | p4 | p4.py | pickaxe | quiltimport | remote-ftp | remote-ftps | \\\n> > +       remote-http | remote-https | replay | request-pull | send-email | \\\n> > +       sh-i18n--envsubst | shell | show | stage | submodule | svn | \\\n> > +       upload-archive--writer | upload-pack | web--browse | whatchanged)\n>\n> Sorry, one more thing: I spot-checked a few of these, and it seems the\n> main issue that causes failures is the exit code; they seem to work\n> with \"-h\" outside a repo. Out of scope for this series, but something\n> worth tidying up as #leftoverbits ?\n\nIt turns out a few pass for me right now: quiltimport and request-pull\nboth work just fine.\n\n-- \nD. Ben Knoble\n"},{"id":"522803","messageId":"CALnO6CDvwbMK_GRdLOBFVdW1XZ5JTuB+Uo5JVPY3Pw_noNBYzA@mail.gmail.com","threadId":"63751","inReplyTo":"20250721115519.140361-3-usmanakinyemi202@gmail.com","subject":"Re: [PATCH v4 2/2] t5200: move `update-server-info -h` test from t1517","fromName":"D. Ben Knoble","fromEmail":"ben.knoble@gmail.com","sentAt":"2025-07-26T16:02:38Z","receivedAt":"2025-07-26T16:02:51Z","isPatch":true,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"On Mon, Jul 21, 2025 at 7:55 AM Usman Akinyemi\n<usmanakinyemi202@gmail.com> wrote:\n>\n> t1517 is now focused on testing subcommands outside a repository.\n> Move the in-repo `-h` test for `update-server-info` to t5200,\n> which covers this command.\n>\n> Suggested-by: Patrick Steinhardt <ps@pks.im>\n> Helped-by: Junio C Hamano <gitster@pobox.com>\n> Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>\n> ---\n>  t/t1517-outside-repo.sh       | 5 -----\n>  t/t5200-update-server-info.sh | 5 +++++\n>  2 files changed, 5 insertions(+), 5 deletions(-)\n>\n> diff --git a/t/t1517-outside-repo.sh b/t/t1517-outside-repo.sh\n> index 9fcebb7d94..a1c644dffa 100755\n> --- a/t/t1517-outside-repo.sh\n> +++ b/t/t1517-outside-repo.sh\n> @@ -107,11 +107,6 @@ test_expect_success LIBCURL 'remote-http outside repository' '\n>         test_grep \"^error: remote-curl\" actual\n>  '\n>\n> -test_expect_success 'update-server-info does not crash with -h' '\n> -       test_expect_code 129 git update-server-info -h >usage &&\n> -       test_grep \"[Uu]sage: git update-server-info \" usage &&\n> -'\n> -\n>  for cmd in $(git --list-cmds=main)\n>  do\n>         cmd=${cmd%.*} # strip .sh, .perl, etc.\n> diff --git a/t/t5200-update-server-info.sh b/t/t5200-update-server-info.sh\n> index 8365907055..a1f129db4e 100755\n> --- a/t/t5200-update-server-info.sh\n> +++ b/t/t5200-update-server-info.sh\n> @@ -46,4 +46,9 @@ test_expect_success 'midx does not create duplicate pack entries' '\n>         test_must_be_empty dups\n>  '\n>\n> +test_expect_success 'update-server-info does not crash with -h' '\n> +       test_expect_code 129 git update-server-info -h >usage &&\n> +       test_grep \"[Uu]sage: git update-server-info \" usage &&\n\nOne other fix I needed locally: in neither the preimage nor postimage\nshould this have a trailing \"&&\"\n\n> +'\n> +\n>  test_done\n> --\n> 2.50.0\n>\n>\n\n\n-- \nD. Ben Knoble\n"},{"id":"522811","messageId":"CAPSxiM_sP7MG5SDLe-_-FULhqmW10M=8Ssu3PMoZD8=rS6CkAA@mail.gmail.com","threadId":"63751","inReplyTo":"CALnO6CCFXfPDZKzx1SBufwzkBJchZr0XYigo_8AQ_U=MuJa7xg@mail.gmail.com","subject":"Re: [PATCH v4 1/2] t/t1517: automate `git subcmd -h` tests outside a repository","fromName":"Usman Akinyemi","fromEmail":"usmanakinyemi202@gmail.com","sentAt":"2025-07-26T21:51:06Z","receivedAt":"2025-07-26T21:51:18Z","isPatch":true,"sender":{"key":"usmanakinyemi202@gmail.com","avatar":"https://avatars.githubusercontent.com/u/86585626?v=4"},"body":"> > +for cmd in $(git --list-cmds=main)\n> > +do\n> > +       cmd=${cmd%.*} # strip .sh, .perl, etc.\n> > +       case \"$cmd\" in\n> > +       archimport | cvsexportcommit | cvsimport | cvsserver | daemon | \\\n> > +       difftool--helper | filter-branch | fsck-objects | get-tar-commit-id | \\\n> > +       http-backend | http-fetch | http-push | init-db | instaweb.sh | \\\n> > +       merge-octopus | merge-one-file | merge-resolve | mergetool | \\\n> > +       mktag | p4 | p4.py | pickaxe | quiltimport | remote-ftp | remote-ftps | \\\n> > +       remote-http | remote-https | replay | request-pull | send-email | \\\n> > +       sh-i18n--envsubst | shell | show | stage | submodule | svn | \\\n> > +       upload-archive--writer | upload-pack | web--browse | whatchanged)\n>\n> Sorry, one more thing: I spot-checked a few of these, and it seems the\n> main issue that causes failures is the exit code; they seem to work\n> with \"-h\" outside a repo. Out of scope for this series, but something\n> worth tidying up as #leftoverbits ?\n>\nYou meant the exit code of 129 right ?\n"},{"id":"522812","messageId":"CAPSxiM9UiCHEwdOuGi0LLQesvEnSLK+eC8ZfTEVQ+cdYedwuXQ@mail.gmail.com","threadId":"63751","inReplyTo":"CALnO6CCN0HUXJVYmvAJO3EoQQZzHVjE0P=g+AUc9c5Ti0Rcm2w@mail.gmail.com","subject":"Re: [PATCH v4 1/2] t/t1517: automate `git subcmd -h` tests outside a repository","fromName":"Usman Akinyemi","fromEmail":"usmanakinyemi202@gmail.com","sentAt":"2025-07-26T21:53:28Z","receivedAt":"2025-07-26T21:53:40Z","isPatch":true,"sender":{"key":"usmanakinyemi202@gmail.com","avatar":"https://avatars.githubusercontent.com/u/86585626?v=4"},"body":"> > +do\n> > +       cmd=${cmd%.*} # strip .sh, .perl, etc.\n> > +       case \"$cmd\" in\n> > +       archimport | cvsexportcommit | cvsimport | cvsserver | daemon | \\\n> > +       difftool--helper | filter-branch | fsck-objects | get-tar-commit-id | \\\n> > +       http-backend | http-fetch | http-push | init-db | instaweb.sh | \\\n> > +       merge-octopus | merge-one-file | merge-resolve | mergetool | \\\n> > +       mktag | p4 | p4.py | pickaxe | quiltimport | remote-ftp | remote-ftps | \\\n>\n> Hm—if we strip the suffix with ${cmd%.*}, do we need a p4.py pattern\n> too? Actually, at first I wondered why we need to strip the suffix at\n> all. My local Git produces only unsuffixed commands. But\n> bin-wrappers/git produces both p4 and p4.py; request-pull and\n> request-pull.sh; and several others. So I think stripping is probably\n> right, just drop the .py pattern.\nNoted and thanks.\n>\n> > +       remote-http | remote-https | replay | request-pull | send-email | \\\n> > +       sh-i18n--envsubst | shell | show | stage | submodule | svn | \\\n> > +       upload-archive--writer | upload-pack | web--browse | whatchanged)\n> > +               expect_outcome=expect_failure ;;\n> > +       *)\n> > +               expect_outcome=expect_success ;;\n> > +       esac\n> > +       test_$expect_outcome \"'git $cmd -h' outside a repository\" '\n> > +               test_expect_code 129 nongit git $cmd -h >usage &&\n> > +               echo \"Hello\" &&\n>\n> Woops! While basing some work on this branch, I spotted this \"echo\"—I\n> assume it's leftover and didn't mean to be included here? Will drop\n> locally for my own work.\n>\nSince you based your work on mine, does it mean I do not have to send\nthe updated patch ?\n"},{"id":"522854","messageId":"xmqqzfcoxshr.fsf@gitster.g","threadId":"63751","inReplyTo":"CALnO6CCN0HUXJVYmvAJO3EoQQZzHVjE0P=g+AUc9c5Ti0Rcm2w@mail.gmail.com","subject":"Re: [PATCH v4 1/2] t/t1517: automate `git subcmd -h` tests outside a repository","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-07-28T15:08:48Z","receivedAt":"2025-07-28T15:08:51Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"D. Ben Knoble\" <ben.knoble@gmail.com> writes:\n\n>> +for cmd in $(git --list-cmds=main)\n>> +do\n>> +       cmd=${cmd%.*} # strip .sh, .perl, etc.\n>> +       case \"$cmd\" in\n>> +       archimport | cvsexportcommit | cvsimport | cvsserver | daemon | \\\n>> +       difftool--helper | filter-branch | fsck-objects | get-tar-commit-id | \\\n>> +       http-backend | http-fetch | http-push | init-db | instaweb.sh | \\\n>> +       merge-octopus | merge-one-file | merge-resolve | mergetool | \\\n>> +       mktag | p4 | p4.py | pickaxe | quiltimport | remote-ftp | remote-ftps | \\\n>\n> Hm—if we strip the suffix with ${cmd%.*}, do we need a p4.py\n> pattern too?  Actually, at first I wondered why we need to strip\n> the suffix at all. My local Git produces only unsuffixed commands.\n> ...\n> bin-wrappers/git produces both p4 and p4.py; request-pull and\n> request-pull.sh; and several others. So I think stripping is probably\n> right, just drop the .py pattern.\n\nAhh, OK, I didn't realize that bin-wrappers gets into the picture.\nSo you're right.  Fixing the bin-wrappers may be necessary, but\ndropping the extra ones is certainly a good idea.\n\n>> +       test_$expect_outcome \"'git $cmd -h' outside a repository\" '\n>> +               test_expect_code 129 nongit git $cmd -h >usage &&\n>> +               echo \"Hello\" &&\n>\n> Woops! While basing some work on this branch, I spotted this \"echo\"—I\n> assume it's leftover and didn't mean to be included here?\n\n;-)\n"},{"id":"522855","messageId":"xmqqv7ncxsgd.fsf@gitster.g","threadId":"63751","inReplyTo":"CALnO6CCFXfPDZKzx1SBufwzkBJchZr0XYigo_8AQ_U=MuJa7xg@mail.gmail.com","subject":"Re: [PATCH v4 1/2] t/t1517: automate `git subcmd -h` tests outside a repository","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-07-28T15:09:38Z","receivedAt":"2025-07-28T15:09:41Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"D. Ben Knoble\" <ben.knoble@gmail.com> writes:\n\n> Sorry, one more thing: I spot-checked a few of these, and it seems the\n> main issue that causes failures is the exit code; they seem to work\n> with \"-h\" outside a repo. Out of scope for this series, but something\n> worth tidying up as #leftoverbits ?\n\nGreat suggestion.  Thanks.\n"},{"id":"523034","messageId":"CALnO6CCJZ+knJr+ANLfNievB3krirDWcnaM7u_KYBRTcfGDE5A@mail.gmail.com","threadId":"63751","inReplyTo":"CAPSxiM9UiCHEwdOuGi0LLQesvEnSLK+eC8ZfTEVQ+cdYedwuXQ@mail.gmail.com","subject":"Re: [PATCH v4 1/2] t/t1517: automate `git subcmd -h` tests outside a repository","fromName":"D. Ben Knoble","fromEmail":"ben.knoble@gmail.com","sentAt":"2025-07-30T21:14:31Z","receivedAt":"2025-07-30T21:14:43Z","isPatch":true,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"On Sat, Jul 26, 2025 at 5:53 PM Usman Akinyemi\n<usmanakinyemi202@gmail.com> wrote:\n> > > +       remote-http | remote-https | replay | request-pull | send-email | \\\n> > > +       sh-i18n--envsubst | shell | show | stage | submodule | svn | \\\n> > > +       upload-archive--writer | upload-pack | web--browse | whatchanged)\n> > > +               expect_outcome=expect_failure ;;\n> > > +       *)\n> > > +               expect_outcome=expect_success ;;\n> > > +       esac\n> > > +       test_$expect_outcome \"'git $cmd -h' outside a repository\" '\n> > > +               test_expect_code 129 nongit git $cmd -h >usage &&\n> > > +               echo \"Hello\" &&\n> >\n> > Woops! While basing some work on this branch, I spotted this \"echo\"—I\n> > assume it's leftover and didn't mean to be included here? Will drop\n> > locally for my own work.\n> >\n> Since you based your work on mine, does it mean I do not have to send\n> the updated patch ?\n\nThat's more a question for Junio than me, but I'm comfortable rebasing\nmy work on top of updated versions of your branch—and I would prefer\nto keep iterations of this series separate from my own, heh.\n\nReally I hope you'll squash my fixes in, and possibly a few others,\nand send another version? For example:\n- pickaxe is a failure because the message is about blame;\n- show is a failure because the message is about log _and_ show;\n- init-db is a failure because the message is about init;\n- whatchanged is a failure because the message is about log/show.\nMaybe these are \"out of scope,\" which is fine—but I think they are\nworking as intended?\n\n-- \nD. Ben Knoble\n"},{"id":"523035","messageId":"CALnO6CBB6AR+PKVveyB0oo0Ax3cFqZ-AAs7o0oo+n9doyJL8KA@mail.gmail.com","threadId":"63751","inReplyTo":"CAPSxiM_sP7MG5SDLe-_-FULhqmW10M=8Ssu3PMoZD8=rS6CkAA@mail.gmail.com","subject":"Re: [PATCH v4 1/2] t/t1517: automate `git subcmd -h` tests outside a repository","fromName":"D. Ben Knoble","fromEmail":"ben.knoble@gmail.com","sentAt":"2025-07-30T21:15:32Z","receivedAt":"2025-07-30T21:15:45Z","isPatch":true,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"On Sat, Jul 26, 2025 at 5:51 PM Usman Akinyemi\n<usmanakinyemi202@gmail.com> wrote:\n>\n> > > +for cmd in $(git --list-cmds=main)\n> > > +do\n> > > +       cmd=${cmd%.*} # strip .sh, .perl, etc.\n> > > +       case \"$cmd\" in\n> > > +       archimport | cvsexportcommit | cvsimport | cvsserver | daemon | \\\n> > > +       difftool--helper | filter-branch | fsck-objects | get-tar-commit-id | \\\n> > > +       http-backend | http-fetch | http-push | init-db | instaweb.sh | \\\n> > > +       merge-octopus | merge-one-file | merge-resolve | mergetool | \\\n> > > +       mktag | p4 | p4.py | pickaxe | quiltimport | remote-ftp | remote-ftps | \\\n> > > +       remote-http | remote-https | replay | request-pull | send-email | \\\n> > > +       sh-i18n--envsubst | shell | show | stage | submodule | svn | \\\n> > > +       upload-archive--writer | upload-pack | web--browse | whatchanged)\n> >\n> > Sorry, one more thing: I spot-checked a few of these, and it seems the\n> > main issue that causes failures is the exit code; they seem to work\n> > with \"-h\" outside a repo. Out of scope for this series, but something\n> > worth tidying up as #leftoverbits ?\n> >\n> You meant the exit code of 129 right ?\n\nYep: some of our commands (often the ones implemented as scripts?)\ndon't exit 129. Fixing that is certainly out-of-scope for this\notherwise-tightly focused series.\n\n-- \nD. Ben Knoble\n"},{"id":"523294","messageId":"CALnO6CAPBsxg=-aXVUUJSKrPLWWPLGdEM=k5J=GVoh5fVTAhYQ@mail.gmail.com","threadId":"63751","inReplyTo":"CALnO6CCN0HUXJVYmvAJO3EoQQZzHVjE0P=g+AUc9c5Ti0Rcm2w@mail.gmail.com","subject":"Re: [PATCH v4 1/2] t/t1517: automate `git subcmd -h` tests outside a repository","fromName":"D. Ben Knoble","fromEmail":"ben.knoble@gmail.com","sentAt":"2025-08-02T19:56:29Z","receivedAt":"2025-08-02T19:56:42Z","isPatch":true,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"On Sat, Jul 26, 2025 at 10:34 AM D. Ben Knoble <ben.knoble@gmail.com> wrote:\n>\n> On Mon, Jul 21, 2025 at 7:55 AM Usman Akinyemi\n> <usmanakinyemi202@gmail.com> wrote:\n> >\n> > Replace manual `-h` tests with a loop over all subcommands using\n> > `git --list-cmds=main`. This ensures consistent coverage of `-h`\n> > behavior outside a repo and future-proofs the test by covering\n> > new commands automatically.\n> >\n> > Known exceptions are skipped or marked as expected failures.\n> >\n> > Suggested-by: Patrick Steinhardt <ps@pks.im>\n> > Helped-by: Junio C Hamano <gitster@pobox.com>\n> > Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>\n> > ---\n> >  t/t1517-outside-repo.sh | 25 +++++++++++++++++++++++--\n> >  1 file changed, 23 insertions(+), 2 deletions(-)\n> >\n> > diff --git a/t/t1517-outside-repo.sh b/t/t1517-outside-repo.sh\n> > index 6824581317..9fcebb7d94 100755\n> > --- a/t/t1517-outside-repo.sh\n> > +++ b/t/t1517-outside-repo.sh\n> > @@ -110,8 +110,29 @@ test_expect_success LIBCURL 'remote-http outside repository' '\n> >  test_expect_success 'update-server-info does not crash with -h' '\n> >         test_expect_code 129 git update-server-info -h >usage &&\n> >         test_grep \"[Uu]sage: git update-server-info \" usage &&\n> > -       test_expect_code 129 nongit git update-server-info -h >usage &&\n> > -       test_grep \"[Uu]sage: git update-server-info \" usage\n> >  '\n> >\n> > +for cmd in $(git --list-cmds=main)\n> > +do\n> > +       cmd=${cmd%.*} # strip .sh, .perl, etc.\n> > +       case \"$cmd\" in\n> > +       archimport | cvsexportcommit | cvsimport | cvsserver | daemon | \\\n> > +       difftool--helper | filter-branch | fsck-objects | get-tar-commit-id | \\\n> > +       http-backend | http-fetch | http-push | init-db | instaweb.sh | \\\n> > +       merge-octopus | merge-one-file | merge-resolve | mergetool | \\\n> > +       mktag | p4 | p4.py | pickaxe | quiltimport | remote-ftp | remote-ftps | \\\n>\n> Hm—if we strip the suffix with ${cmd%.*}, do we need a p4.py pattern\n> too? Actually, at first I wondered why we need to strip the suffix at\n> all. My local Git produces only unsuffixed commands. But\n> bin-wrappers/git produces both p4 and p4.py; request-pull and\n> request-pull.sh; and several others. So I think stripping is probably\n> right, just drop the .py pattern.\n\nI think that using \"instaweb.sh\" instead of \"instaweb\" also causes\nthis to fail on Windows, like:\n\nhttps://github.com/benknoble/git/actions/runs/16695826272/job/47259908953\n\n-- \nD. Ben Knoble\n"},{"id":"523302","messageId":"CAPSxiM978fqvC_TO8fKQrx=S4yPEkp3ZufTq+zv+Ws7zJx6yDg@mail.gmail.com","threadId":"63751","inReplyTo":"CALnO6CAPBsxg=-aXVUUJSKrPLWWPLGdEM=k5J=GVoh5fVTAhYQ@mail.gmail.com","subject":"Re: [PATCH v4 1/2] t/t1517: automate `git subcmd -h` tests outside a repository","fromName":"Usman Akinyemi","fromEmail":"usmanakinyemi202@gmail.com","sentAt":"2025-08-03T01:27:38Z","receivedAt":"2025-08-03T01:27:50Z","isPatch":true,"sender":{"key":"usmanakinyemi202@gmail.com","avatar":"https://avatars.githubusercontent.com/u/86585626?v=4"},"body":"> > Hm—if we strip the suffix with ${cmd%.*}, do we need a p4.py pattern\n> > too? Actually, at first I wondered why we need to strip the suffix at\n> > all. My local Git produces only unsuffixed commands. But\n> > bin-wrappers/git produces both p4 and p4.py; request-pull and\n> > request-pull.sh; and several others. So I think stripping is probably\n> > right, just drop the .py pattern.\n>\n> I think that using \"instaweb.sh\" instead of \"instaweb\" also causes\n> this to fail on Windows, like:\n>\n> https://github.com/benknoble/git/actions/runs/16695826272/job/47259908953\nI think this is expected breakage. Removing \".sh\" makes the #TODO to pass.\n>\n> --\n> D. Ben Knoble\n"},{"id":"523303","messageId":"20250803020744.1037392-1-usmanakinyemi202@gmail.com","threadId":"63751","inReplyTo":"20250721115519.140361-1-usmanakinyemi202@gmail.com","subject":"[PATCH V5 0/3] refactor t1517 to focus on help output outside a repository","fromName":"Usman Akinyemi","fromEmail":"usmanakinyemi202@gmail.com","sentAt":"2025-08-03T02:07:41Z","receivedAt":"2025-08-03T02:07:51Z","isPatch":true,"sender":{"key":"usmanakinyemi202@gmail.com","avatar":"https://avatars.githubusercontent.com/u/86585626?v=4"},"body":"This series refactors t1517-outside-repo.sh to focus on testing\n`git subcmd -h` outside a Git repository. It does two things:\n\n  1. Moves the existing `update-server-info -h` test to t5200, since it\n     tests behavior *inside* a repo and belongs with other update-server-info\n     tests.\n  \n  2. Introduces a loop in t1517 that automatically verifies `-h` output\n     for all main Git subcommands when run outside a repository, using\n     the `nongit` helper and `git --list-cmds=main`.\n\nThis makes t1517 easier to maintain and ensures that new commands are\nautomatically covered for this class of behavior.\n\n\nChanges since v4:\n  - Changes the approach from having the t1517 to test\n  both help outside and inside repo to just having inside repo.\n  - Drop spurious message during test \n  - Fix known breakages that actually work\n  - Fix new t5200 by removing the trailing &&\n  - Move the `prune -h` test to t5304\n\nUsman Akinyemi (3):\n  t/t1517: automate `git subcmd -h` tests outside a repository\n  t5200: move `update-server-info -h` test from t1517\n  t5304: move `prune -h` test from t1517\n\n t/t1517-outside-repo.sh       | 34 +++++++++++++++++++++-------------\n t/t5200-update-server-info.sh |  5 +++++\n t/t5304-prune.sh              |  5 +++++\n 3 files changed, 31 insertions(+), 13 deletions(-)\n\nRange-diff against v2:\n\n1:  11eb3e7bfe < -:  ---------- t/t1517: automate `git subcmd -h` tests outside a repository\n-:  ---------- > 1:  75a1d540e4 t/t1517: automate `git subcmd -h` tests outside a repository\n2:  5cf43192d0 ! 2:  8c028256a0 t5200: move `update-server-info -h` test from t1517\n    @@ t/t1517-outside-repo.sh: test_expect_success LIBCURL 'remote-http outside reposi\n      \n     -test_expect_success 'update-server-info does not crash with -h' '\n     -\ttest_expect_code 129 git update-server-info -h >usage &&\n    --\ttest_grep \"[Uu]sage: git update-server-info \" usage &&\n    +-\ttest_grep \"[Uu]sage: git update-server-info \" usage\n     -'\n     -\n    + test_expect_success 'prune does not crash with -h' '\n    + \ttest_expect_code 129 git prune -h >usage &&\n    + \ttest_grep \"[Uu]sage: git prune \" usage &&\n    + \ttest_expect_code 129 nongit git prune -h >usage &&\n    + \ttest_grep \"[Uu]sage: git prune \" usage\n    + '\n    ++\n      for cmd in $(git --list-cmds=main)\n      do\n      \tcmd=${cmd%.*} # strip .sh, .perl, etc.\n    @@ t/t5200-update-server-info.sh: test_expect_success 'midx does not create duplica\n      \n     +test_expect_success 'update-server-info does not crash with -h' '\n     +\ttest_expect_code 129 git update-server-info -h >usage &&\n    -+\ttest_grep \"[Uu]sage: git update-server-info \" usage &&\n    ++\ttest_grep \"[Uu]sage: git update-server-info \" usage\n     +'\n     +\n      test_done\n-:  ---------- > 3:  c1cdbf272f t5304: move `prune -h` test from t1517\n-- \n2.50.1\n\n"},{"id":"523304","messageId":"20250803020744.1037392-2-usmanakinyemi202@gmail.com","threadId":"63751","inReplyTo":"20250803020744.1037392-1-usmanakinyemi202@gmail.com","subject":"[PATCH V5 1/3] t/t1517: automate `git subcmd -h` tests outside a repository","fromName":"Usman Akinyemi","fromEmail":"usmanakinyemi202@gmail.com","sentAt":"2025-08-03T02:07:42Z","receivedAt":"2025-08-03T02:07:54Z","isPatch":true,"sender":{"key":"usmanakinyemi202@gmail.com","avatar":"https://avatars.githubusercontent.com/u/86585626?v=4"},"body":"Replace manual `-h` tests with a loop over all subcommands using\n`git --list-cmds=main`. This ensures consistent coverage of `-h`\nbehavior outside a repo and future-proofs the test by covering\nnew commands automatically.\n\nKnown exceptions are skipped or marked as expected failures.\n\nSuggested-by: Patrick Steinhardt <ps@pks.im>\nHelped-by: Junio C Hamano <gitster@pobox.com>\nHelped-by: D. Ben Knoble <ben.knoble+github@gmail.com>\nSigned-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>\n---\n t/t1517-outside-repo.sh | 23 +++++++++++++++++++++--\n 1 file changed, 21 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t1517-outside-repo.sh b/t/t1517-outside-repo.sh\nindex 8f59b867f2..4a827b96f0 100755\n--- a/t/t1517-outside-repo.sh\n+++ b/t/t1517-outside-repo.sh\n@@ -109,8 +109,6 @@ test_expect_success LIBCURL 'remote-http outside repository' '\n \n test_expect_success 'update-server-info does not crash with -h' '\n \ttest_expect_code 129 git update-server-info -h >usage &&\n-\ttest_grep \"[Uu]sage: git update-server-info \" usage &&\n-\ttest_expect_code 129 nongit git update-server-info -h >usage &&\n \ttest_grep \"[Uu]sage: git update-server-info \" usage\n '\n \n@@ -120,5 +118,26 @@ test_expect_success 'prune does not crash with -h' '\n \ttest_expect_code 129 nongit git prune -h >usage &&\n \ttest_grep \"[Uu]sage: git prune \" usage\n '\n+for cmd in $(git --list-cmds=main)\n+do\n+\tcmd=${cmd%.*} # strip .sh, .perl, etc.\n+\tcase \"$cmd\" in\n+\tarchimport | cvsexportcommit | cvsimport | cvsserver | daemon | \\\n+\tdifftool--helper | filter-branch | fsck-objects | get-tar-commit-id | \\\n+\thttp-backend | http-fetch | http-push | init-db | \\\n+\tmerge-octopus | merge-one-file | merge-resolve | mergetool | \\\n+\tmktag | p4 | p4.py | pickaxe | remote-ftp | remote-ftps | \\\n+\tremote-http | remote-https | replay | send-email | \\\n+\tsh-i18n--envsubst | shell | show | stage | submodule | svn | \\\n+\tupload-archive--writer | upload-pack | web--browse | whatchanged)\n+\t\texpect_outcome=expect_failure ;;\n+\t*)\n+\t\texpect_outcome=expect_success ;;\n+\tesac\n+\ttest_$expect_outcome \"'git $cmd -h' outside a repository\" '\n+\t\ttest_expect_code 129 nongit git $cmd -h >usage &&\n+\t\ttest_grep \"[Uu]sage: git $cmd \" usage\n+\t'\n+done\n \n test_done\n-- \n2.50.1\n\n"},{"id":"523305","messageId":"20250803020744.1037392-3-usmanakinyemi202@gmail.com","threadId":"63751","inReplyTo":"20250803020744.1037392-1-usmanakinyemi202@gmail.com","subject":"[PATCH V5 2/3] t5200: move `update-server-info -h` test from t1517","fromName":"Usman Akinyemi","fromEmail":"usmanakinyemi202@gmail.com","sentAt":"2025-08-03T02:07:43Z","receivedAt":"2025-08-03T02:07:57Z","isPatch":true,"sender":{"key":"usmanakinyemi202@gmail.com","avatar":"https://avatars.githubusercontent.com/u/86585626?v=4"},"body":"t1517 is now focused on testing subcommands outside a repository.\nMove the in-repo `-h` test for `update-server-info` to t5200,\nwhich covers this command.\n\nSuggested-by: Patrick Steinhardt <ps@pks.im>\nHelped-by: Junio C Hamano <gitster@pobox.com>\nSigned-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>\n---\n t/t1517-outside-repo.sh       | 6 +-----\n t/t5200-update-server-info.sh | 5 +++++\n 2 files changed, 6 insertions(+), 5 deletions(-)\n\ndiff --git a/t/t1517-outside-repo.sh b/t/t1517-outside-repo.sh\nindex 4a827b96f0..3623272db3 100755\n--- a/t/t1517-outside-repo.sh\n+++ b/t/t1517-outside-repo.sh\n@@ -107,17 +107,13 @@ test_expect_success LIBCURL 'remote-http outside repository' '\n \ttest_grep \"^error: remote-curl\" actual\n '\n \n-test_expect_success 'update-server-info does not crash with -h' '\n-\ttest_expect_code 129 git update-server-info -h >usage &&\n-\ttest_grep \"[Uu]sage: git update-server-info \" usage\n-'\n-\n test_expect_success 'prune does not crash with -h' '\n \ttest_expect_code 129 git prune -h >usage &&\n \ttest_grep \"[Uu]sage: git prune \" usage &&\n \ttest_expect_code 129 nongit git prune -h >usage &&\n \ttest_grep \"[Uu]sage: git prune \" usage\n '\n+\n for cmd in $(git --list-cmds=main)\n do\n \tcmd=${cmd%.*} # strip .sh, .perl, etc.\ndiff --git a/t/t5200-update-server-info.sh b/t/t5200-update-server-info.sh\nindex 8365907055..a551e955b5 100755\n--- a/t/t5200-update-server-info.sh\n+++ b/t/t5200-update-server-info.sh\n@@ -46,4 +46,9 @@ test_expect_success 'midx does not create duplicate pack entries' '\n \ttest_must_be_empty dups\n '\n \n+test_expect_success 'update-server-info does not crash with -h' '\n+\ttest_expect_code 129 git update-server-info -h >usage &&\n+\ttest_grep \"[Uu]sage: git update-server-info \" usage\n+'\n+\n test_done\n-- \n2.50.1\n\n"},{"id":"523306","messageId":"20250803020744.1037392-4-usmanakinyemi202@gmail.com","threadId":"63751","inReplyTo":"20250803020744.1037392-1-usmanakinyemi202@gmail.com","subject":"[PATCH V5 3/3] t5304: move `prune -h` test from t1517","fromName":"Usman Akinyemi","fromEmail":"usmanakinyemi202@gmail.com","sentAt":"2025-08-03T02:07:44Z","receivedAt":"2025-08-03T02:08:01Z","isPatch":true,"sender":{"key":"usmanakinyemi202@gmail.com","avatar":"https://avatars.githubusercontent.com/u/86585626?v=4"},"body":"t1517 is now focused on testing subcommands outside a repository.\nMove the in-repo `-h` test for `prune` to t5304, which covers\nthis command.\n\nSuggested-by: Patrick Steinhardt <ps@pks.im>\nSigned-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>\n---\n t/t1517-outside-repo.sh | 7 -------\n t/t5304-prune.sh        | 5 +++++\n 2 files changed, 5 insertions(+), 7 deletions(-)\n\ndiff --git a/t/t1517-outside-repo.sh b/t/t1517-outside-repo.sh\nindex 3623272db3..8a417af47a 100755\n--- a/t/t1517-outside-repo.sh\n+++ b/t/t1517-outside-repo.sh\n@@ -107,13 +107,6 @@ test_expect_success LIBCURL 'remote-http outside repository' '\n \ttest_grep \"^error: remote-curl\" actual\n '\n \n-test_expect_success 'prune does not crash with -h' '\n-\ttest_expect_code 129 git prune -h >usage &&\n-\ttest_grep \"[Uu]sage: git prune \" usage &&\n-\ttest_expect_code 129 nongit git prune -h >usage &&\n-\ttest_grep \"[Uu]sage: git prune \" usage\n-'\n-\n for cmd in $(git --list-cmds=main)\n do\n \tcmd=${cmd%.*} # strip .sh, .perl, etc.\ndiff --git a/t/t5304-prune.sh b/t/t5304-prune.sh\nindex 1f1f664871..2be7cd30de 100755\n--- a/t/t5304-prune.sh\n+++ b/t/t5304-prune.sh\n@@ -364,4 +364,9 @@ test_expect_success 'gc.recentObjectsHook' '\n \tgit cat-file -p $BLOB\n '\n \n+test_expect_success 'prune does not crash with -h' '\n+\ttest_expect_code 129 git prune -h >usage &&\n+\ttest_grep \"[Uu]sage: git prune \" usage\n+'\n+\n test_done\n-- \n2.50.1\n\n"},{"id":"523339","messageId":"CALnO6CBCynikVcZq17SxOTfwuRMM86cv+BWQb0zZoOdMYX-72g@mail.gmail.com","threadId":"63751","inReplyTo":"20250803020744.1037392-2-usmanakinyemi202@gmail.com","subject":"Re: [PATCH V5 1/3] t/t1517: automate `git subcmd -h` tests outside a repository","fromName":"D. Ben Knoble","fromEmail":"ben.knoble@gmail.com","sentAt":"2025-08-03T14:52:56Z","receivedAt":"2025-08-03T14:53:09Z","isPatch":true,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"On Sat, Aug 2, 2025 at 10:07 PM Usman Akinyemi\n<usmanakinyemi202@gmail.com> wrote:\n>\n> Replace manual `-h` tests with a loop over all subcommands using\n> `git --list-cmds=main`. This ensures consistent coverage of `-h`\n> behavior outside a repo and future-proofs the test by covering\n> new commands automatically.\n>\n> Known exceptions are skipped or marked as expected failures.\n>\n> Suggested-by: Patrick Steinhardt <ps@pks.im>\n> Helped-by: Junio C Hamano <gitster@pobox.com>\n> Helped-by: D. Ben Knoble <ben.knoble+github@gmail.com>\n> Signed-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>\n> ---\n>  t/t1517-outside-repo.sh | 23 +++++++++++++++++++++--\n>  1 file changed, 21 insertions(+), 2 deletions(-)\n>\n> diff --git a/t/t1517-outside-repo.sh b/t/t1517-outside-repo.sh\n> index 8f59b867f2..4a827b96f0 100755\n> --- a/t/t1517-outside-repo.sh\n> +++ b/t/t1517-outside-repo.sh\n> @@ -109,8 +109,6 @@ test_expect_success LIBCURL 'remote-http outside repository' '\n>\n>  test_expect_success 'update-server-info does not crash with -h' '\n>         test_expect_code 129 git update-server-info -h >usage &&\n> -       test_grep \"[Uu]sage: git update-server-info \" usage &&\n> -       test_expect_code 129 nongit git update-server-info -h >usage &&\n>         test_grep \"[Uu]sage: git update-server-info \" usage\n>  '\n>\n> @@ -120,5 +118,26 @@ test_expect_success 'prune does not crash with -h' '\n>         test_expect_code 129 nongit git prune -h >usage &&\n>         test_grep \"[Uu]sage: git prune \" usage\n>  '\n> +for cmd in $(git --list-cmds=main)\n> +do\n\nThis part of the patch does not apply cleanly to v2.50.0 (the original\nbase of the series), but I was able to apply to latest master\n(866e6a391f (The sixteenth batch, 2025-08-01)). It seems like the\nconflict was due to 7cd03a555a (builtin/prune: stop depending on\n'the_repository', 2025-07-04).\n\nAll fine, just leaving a note for myself ;) I didn't see any mention\nof the changed base in the cover letter, so I was confused. (Rebasing\nonto latest master makes sense to me, but I'm not sure what the list\nconvention is).\n\nPS I think we want a newline after the closing quote of the prune test\nand before the start of the loop.\n\n> +       cmd=${cmd%.*} # strip .sh, .perl, etc.\n> +       case \"$cmd\" in\n> +       archimport | cvsexportcommit | cvsimport | cvsserver | daemon | \\\n> +       difftool--helper | filter-branch | fsck-objects | get-tar-commit-id | \\\n> +       http-backend | http-fetch | http-push | init-db | \\\n> +       merge-octopus | merge-one-file | merge-resolve | mergetool | \\\n> +       mktag | p4 | p4.py | pickaxe | remote-ftp | remote-ftps | \\\n> +       remote-http | remote-https | replay | send-email | \\\n> +       sh-i18n--envsubst | shell | show | stage | submodule | svn | \\\n> +       upload-archive--writer | upload-pack | web--browse | whatchanged)\n> +               expect_outcome=expect_failure ;;\n> +       *)\n> +               expect_outcome=expect_success ;;\n> +       esac\n> +       test_$expect_outcome \"'git $cmd -h' outside a repository\" '\n> +               test_expect_code 129 nongit git $cmd -h >usage &&\n> +               test_grep \"[Uu]sage: git $cmd \" usage\n> +       '\n> +done\n>\n>  test_done\n> --\n> 2.50.1\n>\n\nI have had to deal with yet more instaweb issues [1], which I think\nare because the Windows CI runs without Perl. I'm trying to come up\nwith a fix there, but any advice welcome. (I think we just need to\nmark that test with the Perl pre-req, but it's interesting that this\nis the only command I've seen have that problem.)\n\nLooks like Makefile:2664 is the responsible code, which I couldn't\nfind from just looking at the instaweb script (instead had to grep the\nerror message -> grep for use of the \"unimplemented\" script).\n\n[1]: https://github.com/benknoble/git/actions/runs/16699688470/job/47268852351\n\n--\nD. Ben Knoble\n"},{"id":"523353","messageId":"xmqqpldce24h.fsf@gitster.g","threadId":"63751","inReplyTo":"CALnO6CBCynikVcZq17SxOTfwuRMM86cv+BWQb0zZoOdMYX-72g@mail.gmail.com","subject":"Re: [PATCH V5 1/3] t/t1517: automate `git subcmd -h` tests outside a repository","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-08-03T17:39:10Z","receivedAt":"2025-08-03T17:39:14Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"D. Ben Knoble\" <ben.knoble@gmail.com> writes:\n\n> All fine, just leaving a note for myself ;) I didn't see any mention\n> of the changed base in the cover letter, so I was confused. (Rebasing\n> onto latest master makes sense to me, but I'm not sure what the list\n> convention is).\n\nOnce you picked a base, usually it is a good idea to keep it, unless\nmaking a trial merge of the resulting topic branch into 'master'\nleaves conflicts that are not trivial.  And I do appreciate your\nnoticing and mentioning that it is recommended to have a comment in\nthe cover letter (or a comment after the three-dash line if a single\npatch topic) that the new iteration has been based on which commit.\n\nThanks.\n"},{"id":"523639","messageId":"CAPSxiM9d9LkH125ikjwRc1z7PQZfDYpkab0ZHQKFrCpxg6eVJQ@mail.gmail.com","threadId":"63751","inReplyTo":"xmqqpldce24h.fsf@gitster.g","subject":"Re: [PATCH V5 1/3] t/t1517: automate `git subcmd -h` tests outside a repository","fromName":"Usman Akinyemi","fromEmail":"usmanakinyemi202@gmail.com","sentAt":"2025-08-06T07:20:30Z","receivedAt":"2025-08-06T07:20:42Z","isPatch":true,"sender":{"key":"usmanakinyemi202@gmail.com","avatar":"https://avatars.githubusercontent.com/u/86585626?v=4"},"body":"On Sun, Aug 3, 2025 at 11:09 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> \"D. Ben Knoble\" <ben.knoble@gmail.com> writes:\n>\n> > All fine, just leaving a note for myself ;) I didn't see any mention\n> > of the changed base in the cover letter, so I was confused. (Rebasing\n> > onto latest master makes sense to me, but I'm not sure what the list\n> > convention is).\n>\n> Once you picked a base, usually it is a good idea to keep it, unless\n> making a trial merge of the resulting topic branch into 'master'\n> leaves conflicts that are not trivial.  And I do appreciate your\n> noticing and mentioning that it is recommended to have a comment in\n> the cover letter (or a comment after the three-dash line if a single\n> patch topic) that the new iteration has been based on which commit.\nThanks for this and noted.\n>\n> Thanks.\n"},{"id":"523788","messageId":"20250808010651.591906-1-usmanakinyemi202@gmail.com","threadId":"63751","inReplyTo":"20250803020744.1037392-1-usmanakinyemi202@gmail.com","subject":"[PATCH v6 0/3] refactor t1517 to focus on help output outside a repository","fromName":"Usman Akinyemi","fromEmail":"usmanakinyemi202@gmail.com","sentAt":"2025-08-08T01:06:48Z","receivedAt":"2025-08-08T01:06:59Z","isPatch":true,"sender":{"key":"usmanakinyemi202@gmail.com","avatar":"https://avatars.githubusercontent.com/u/86585626?v=4"},"body":"This series refactors t1517-outside-repo.sh to focus on testing\n`git subcmd -h` outside a Git repository. It does two things:\n\n  1. Moves the existing `update-server-info -h` test to t5200, since it\n     tests behavior inside a repo and belongs with other update-server-info\n     tests.\n\n  2. Moves the existing `prune -h` test to t5304, since it\n     tests behavior inside a repo and belongs with other prune tests.\n\n  3. Introduces a loop in t1517 that automatically verifies `-h` output\n     for all main Git subcommands when run outside a repository, using\n     the `nongit` helper and `git --list-cmds=main`.\n\nThis makes t1517 easier to maintain and ensures that new commands are\nautomatically covered for this class of behavior.\n\nChanges since v5:\n- fix instaweb test using PERL prereqs (helped by Ben)\n\nNote:\nThis new iteration is based on\n7cd03a555a (builtin/prune: stop depending on 'the_repository', 2025-07-04)\ncommit.\n\n\nUsman Akinyemi (3):\n  t/t1517: automate `git subcmd -h` tests outside a repository\n  t5200: move `update-server-info -h` test from t1517\n  t5304: move `prune -h` test from t1517\n\n t/t1517-outside-repo.sh       | 40 +++++++++++++++++++++++------------\n t/t5200-update-server-info.sh |  5 +++++\n t/t5304-prune.sh              |  5 +++++\n 3 files changed, 37 insertions(+), 13 deletions(-)\n\n-- \n2.50.1\n\n"},{"id":"523789","messageId":"20250808010651.591906-2-usmanakinyemi202@gmail.com","threadId":"63751","inReplyTo":"20250808010651.591906-1-usmanakinyemi202@gmail.com","subject":"[PATCH v6 1/3] t/t1517: automate `git subcmd -h` tests outside a repository","fromName":"Usman Akinyemi","fromEmail":"usmanakinyemi202@gmail.com","sentAt":"2025-08-08T01:06:49Z","receivedAt":"2025-08-08T01:07:02Z","isPatch":true,"sender":{"key":"usmanakinyemi202@gmail.com","avatar":"https://avatars.githubusercontent.com/u/86585626?v=4"},"body":"Replace manual `-h` tests with a loop over all subcommands using\n`git --list-cmds=main`. This ensures consistent coverage of `-h`\nbehavior outside a repo and future-proofs the test by covering\nnew commands automatically.\n\nKnown exceptions are skipped or marked as expected failures.\n\nSuggested-by: Patrick Steinhardt <ps@pks.im>\nHelped-by: Junio C Hamano <gitster@pobox.com>\nHelped-by: D. Ben Knoble <ben.knoble+github@gmail.com>\nSigned-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>\n---\n t/t1517-outside-repo.sh | 30 ++++++++++++++++++++++++++++--\n 1 file changed, 28 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t1517-outside-repo.sh b/t/t1517-outside-repo.sh\nindex 8f59b867f2..e9f6d03e1b 100755\n--- a/t/t1517-outside-repo.sh\n+++ b/t/t1517-outside-repo.sh\n@@ -109,8 +109,6 @@ test_expect_success LIBCURL 'remote-http outside repository' '\n \n test_expect_success 'update-server-info does not crash with -h' '\n \ttest_expect_code 129 git update-server-info -h >usage &&\n-\ttest_grep \"[Uu]sage: git update-server-info \" usage &&\n-\ttest_expect_code 129 nongit git update-server-info -h >usage &&\n \ttest_grep \"[Uu]sage: git update-server-info \" usage\n '\n \n@@ -121,4 +119,32 @@ test_expect_success 'prune does not crash with -h' '\n \ttest_grep \"[Uu]sage: git prune \" usage\n '\n \n+for cmd in $(git --list-cmds=main)\n+do\n+\tcmd=${cmd%.*} # strip .sh, .perl, etc.\n+\tcase \"$cmd\" in\n+\tarchimport | cvsexportcommit | cvsimport | cvsserver | daemon | \\\n+\tdifftool--helper | filter-branch | fsck-objects | get-tar-commit-id | \\\n+\thttp-backend | http-fetch | http-push | init-db | \\\n+\tmerge-octopus | merge-one-file | merge-resolve | mergetool | \\\n+\tmktag | p4 | p4.py | pickaxe | remote-ftp | remote-ftps | \\\n+\tremote-http | remote-https | replay | send-email | \\\n+\tsh-i18n--envsubst | shell | show | stage | submodule | svn | \\\n+\tupload-archive--writer | upload-pack | web--browse | whatchanged)\n+\t\texpect_outcome=expect_failure ;;\n+\t*)\n+\t\texpect_outcome=expect_success ;;\n+\tesac\n+\tcase \"$cmd\" in\n+\tinstaweb)\n+\t\tprereq=PERL ;;\n+\t*)\n+\t\tprereq= ;;\n+\tesac\n+\ttest_$expect_outcome $prereq \"'git $cmd -h' outside a repository\" '\n+\t\ttest_expect_code 129 nongit git $cmd -h >usage &&\n+\t\ttest_grep \"[Uu]sage: git $cmd \" usage\n+\t'\n+done\n+\n test_done\n-- \n2.50.1\n\n"},{"id":"523790","messageId":"20250808010651.591906-3-usmanakinyemi202@gmail.com","threadId":"63751","inReplyTo":"20250808010651.591906-1-usmanakinyemi202@gmail.com","subject":"[PATCH v6 2/3] t5200: move `update-server-info -h` test from t1517","fromName":"Usman Akinyemi","fromEmail":"usmanakinyemi202@gmail.com","sentAt":"2025-08-08T01:06:50Z","receivedAt":"2025-08-08T01:07:06Z","isPatch":true,"sender":{"key":"usmanakinyemi202@gmail.com","avatar":"https://avatars.githubusercontent.com/u/86585626?v=4"},"body":"t1517 is now focused on testing subcommands outside a repository.\nMove the in-repo `-h` test for `update-server-info` to t5200,\nwhich covers this command.\n\nSuggested-by: Patrick Steinhardt <ps@pks.im>\nHelped-by: Junio C Hamano <gitster@pobox.com>\nSigned-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>\n---\n t/t1517-outside-repo.sh       | 5 -----\n t/t5200-update-server-info.sh | 5 +++++\n 2 files changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/t/t1517-outside-repo.sh b/t/t1517-outside-repo.sh\nindex e9f6d03e1b..4eba3f486d 100755\n--- a/t/t1517-outside-repo.sh\n+++ b/t/t1517-outside-repo.sh\n@@ -107,11 +107,6 @@ test_expect_success LIBCURL 'remote-http outside repository' '\n \ttest_grep \"^error: remote-curl\" actual\n '\n \n-test_expect_success 'update-server-info does not crash with -h' '\n-\ttest_expect_code 129 git update-server-info -h >usage &&\n-\ttest_grep \"[Uu]sage: git update-server-info \" usage\n-'\n-\n test_expect_success 'prune does not crash with -h' '\n \ttest_expect_code 129 git prune -h >usage &&\n \ttest_grep \"[Uu]sage: git prune \" usage &&\ndiff --git a/t/t5200-update-server-info.sh b/t/t5200-update-server-info.sh\nindex 8365907055..a551e955b5 100755\n--- a/t/t5200-update-server-info.sh\n+++ b/t/t5200-update-server-info.sh\n@@ -46,4 +46,9 @@ test_expect_success 'midx does not create duplicate pack entries' '\n \ttest_must_be_empty dups\n '\n \n+test_expect_success 'update-server-info does not crash with -h' '\n+\ttest_expect_code 129 git update-server-info -h >usage &&\n+\ttest_grep \"[Uu]sage: git update-server-info \" usage\n+'\n+\n test_done\n-- \n2.50.1\n\n"},{"id":"523791","messageId":"20250808010651.591906-4-usmanakinyemi202@gmail.com","threadId":"63751","inReplyTo":"20250808010651.591906-1-usmanakinyemi202@gmail.com","subject":"[PATCH v6 3/3] t5304: move `prune -h` test from t1517","fromName":"Usman Akinyemi","fromEmail":"usmanakinyemi202@gmail.com","sentAt":"2025-08-08T01:06:51Z","receivedAt":"2025-08-08T01:07:09Z","isPatch":true,"sender":{"key":"usmanakinyemi202@gmail.com","avatar":"https://avatars.githubusercontent.com/u/86585626?v=4"},"body":"t1517 is now focused on testing subcommands outside a repository.\nMove the in-repo `-h` test for `prune` to t5304, which covers\nthis command.\n\nSuggested-by: Patrick Steinhardt <ps@pks.im>\nSigned-off-by: Usman Akinyemi <usmanakinyemi202@gmail.com>\n---\n t/t1517-outside-repo.sh | 7 -------\n t/t5304-prune.sh        | 5 +++++\n 2 files changed, 5 insertions(+), 7 deletions(-)\n\ndiff --git a/t/t1517-outside-repo.sh b/t/t1517-outside-repo.sh\nindex 4eba3f486d..3dc602872a 100755\n--- a/t/t1517-outside-repo.sh\n+++ b/t/t1517-outside-repo.sh\n@@ -107,13 +107,6 @@ test_expect_success LIBCURL 'remote-http outside repository' '\n \ttest_grep \"^error: remote-curl\" actual\n '\n \n-test_expect_success 'prune does not crash with -h' '\n-\ttest_expect_code 129 git prune -h >usage &&\n-\ttest_grep \"[Uu]sage: git prune \" usage &&\n-\ttest_expect_code 129 nongit git prune -h >usage &&\n-\ttest_grep \"[Uu]sage: git prune \" usage\n-'\n-\n for cmd in $(git --list-cmds=main)\n do\n \tcmd=${cmd%.*} # strip .sh, .perl, etc.\ndiff --git a/t/t5304-prune.sh b/t/t5304-prune.sh\nindex 1f1f664871..2be7cd30de 100755\n--- a/t/t5304-prune.sh\n+++ b/t/t5304-prune.sh\n@@ -364,4 +364,9 @@ test_expect_success 'gc.recentObjectsHook' '\n \tgit cat-file -p $BLOB\n '\n \n+test_expect_success 'prune does not crash with -h' '\n+\ttest_expect_code 129 git prune -h >usage &&\n+\ttest_grep \"[Uu]sage: git prune \" usage\n+'\n+\n test_done\n-- \n2.50.1\n\n"},{"id":"523820","messageId":"xmqqldntkgq0.fsf@gitster.g","threadId":"63751","inReplyTo":"20250808010651.591906-1-usmanakinyemi202@gmail.com","subject":"Re: [PATCH v6 0/3] refactor t1517 to focus on help output outside a repository","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-08-08T14:53:11Z","receivedAt":"2025-08-08T14:53:14Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Usman Akinyemi <usmanakinyemi202@gmail.com> writes:\n\n> This series refactors t1517-outside-repo.sh to focus on testing\n> `git subcmd -h` outside a Git repository. It does two things:\n\nThanks, Usman and Ben.  This iteration looks perfect.  Let's mark it\nfor 'next'.\n\n"},{"id":"523871","messageId":"CALnO6CCRKuSw3FqqPisavafDrVR8H-8UtjjWWsK2oYeN1COLmQ@mail.gmail.com","threadId":"63751","inReplyTo":"xmqqldntkgq0.fsf@gitster.g","subject":"Re: [PATCH v6 0/3] refactor t1517 to focus on help output outside a repository","fromName":"D. Ben Knoble","fromEmail":"ben.knoble@gmail.com","sentAt":"2025-08-09T14:46:08Z","receivedAt":"2025-08-09T14:46:21Z","isPatch":true,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"On Fri, Aug 8, 2025 at 10:53 AM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Usman Akinyemi <usmanakinyemi202@gmail.com> writes:\n>\n> > This series refactors t1517-outside-repo.sh to focus on testing\n> > `git subcmd -h` outside a Git repository. It does two things:\n>\n> Thanks, Usman and Ben.  This iteration looks perfect.  Let's mark it\n> for 'next'.\n>\n\nExcellent! In the recent \"cooking\" mail it looks like my series was\nrecreated atop this one, so I won't send another version just to drop\nthe fixup patch unless there are other comments to address.\n\n-- \nD. Ben Knoble\n"},{"id":"524969","messageId":"370f11e1-b335-4111-912c-94429c5018d6@gmail.com","threadId":"63751","inReplyTo":"20250721115519.140361-2-usmanakinyemi202@gmail.com","subject":"Re: [PATCH v4 1/2] t/t1517: automate `git subcmd -h` tests outside a repository","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2025-08-26T15:57:25Z","receivedAt":"2025-08-26T15:57:29Z","isPatch":true,"sender":{"key":"phillip.wood@dunelm.org.uk","avatar":null},"body":"Hi Usman\n\nOn 21/07/2025 12:55, Usman Akinyemi wrote:\n> \n> diff --git a/t/t1517-outside-repo.sh b/t/t1517-outside-repo.sh\n> index 6824581317..9fcebb7d94 100755\n> --- a/t/t1517-outside-repo.sh\n> +++ b/t/t1517-outside-repo.sh\n> @@ -110,8 +110,29 @@ test_expect_success LIBCURL 'remote-http outside repository' '\n>   test_expect_success 'update-server-info does not crash with -h' '\n>   \ttest_expect_code 129 git update-server-info -h >usage &&\n>   \ttest_grep \"[Uu]sage: git update-server-info \" usage &&\n> -\ttest_expect_code 129 nongit git update-server-info -h >usage &&\n> -\ttest_grep \"[Uu]sage: git update-server-info \" usage\n>   '\n>   \n> +for cmd in $(git --list-cmds=main)\n\nThis lists all the git commands in $PATH which is causing \"make test\" to \nfail when I run it locally as it is testing all my local \"git-*\" scripts \nmost of which apparently fail this test. If there isn't already we \nshould add a option that lists the commands only in $GIT_EXEC_PATH and \nuse it here.\n\nAlso when I run the test with '-i' it does not stop at the first \nfailure. I'm not sure what's causing that as I thought \ntest_expect_success should exit on failure even when it is called in a loop.\n\nThanks\n\nPhillip\n\n> +do\n> +\tcmd=${cmd%.*} # strip .sh, .perl, etc.\n> +\tcase \"$cmd\" in\n> +\tarchimport | cvsexportcommit | cvsimport | cvsserver | daemon | \\\n> +\tdifftool--helper | filter-branch | fsck-objects | get-tar-commit-id | \\\n> +\thttp-backend | http-fetch | http-push | init-db | instaweb.sh | \\\n> +\tmerge-octopus | merge-one-file | merge-resolve | mergetool | \\\n> +\tmktag | p4 | p4.py | pickaxe | quiltimport | remote-ftp | remote-ftps | \\\n> +\tremote-http | remote-https | replay | request-pull | send-email | \\\n> +\tsh-i18n--envsubst | shell | show | stage | submodule | svn | \\\n> +\tupload-archive--writer | upload-pack | web--browse | whatchanged)\n> +\t\texpect_outcome=expect_failure ;;\n> +\t*)\n> +\t\texpect_outcome=expect_success ;;\n> +\tesac\n> +\ttest_$expect_outcome \"'git $cmd -h' outside a repository\" '\n> +\t\ttest_expect_code 129 nongit git $cmd -h >usage &&\n> +\t\techo \"Hello\" &&\n> +\t\ttest_grep \"[Uu]sage: git $cmd \" usage\n> +\t'\n> +done\n> +\n>   test_done\n\n"},{"id":"525104","messageId":"CALnO6CBbEB=94YsZn8vtjcwYENuMhMdg_wb2RbQunVCxnf53jQ@mail.gmail.com","threadId":"63751","inReplyTo":"370f11e1-b335-4111-912c-94429c5018d6@gmail.com","subject":"Re: [PATCH v4 1/2] t/t1517: automate `git subcmd -h` tests outside a repository","fromName":"D. Ben Knoble","fromEmail":"ben.knoble@gmail.com","sentAt":"2025-08-28T13:47:35Z","receivedAt":"2025-08-28T13:47:49Z","isPatch":true,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"On Tue, Aug 26, 2025 at 12:04 PM Phillip Wood <phillip.wood123@gmail.com> wrote:\n>\n> Hi Usman\n>\n> On 21/07/2025 12:55, Usman Akinyemi wrote:\n> >\n> > diff --git a/t/t1517-outside-repo.sh b/t/t1517-outside-repo.sh\n> > index 6824581317..9fcebb7d94 100755\n> > --- a/t/t1517-outside-repo.sh\n> > +++ b/t/t1517-outside-repo.sh\n> > @@ -110,8 +110,29 @@ test_expect_success LIBCURL 'remote-http outside repository' '\n> >   test_expect_success 'update-server-info does not crash with -h' '\n> >       test_expect_code 129 git update-server-info -h >usage &&\n> >       test_grep \"[Uu]sage: git update-server-info \" usage &&\n> > -     test_expect_code 129 nongit git update-server-info -h >usage &&\n> > -     test_grep \"[Uu]sage: git update-server-info \" usage\n> >   '\n> >\n> > +for cmd in $(git --list-cmds=main)\n>\n> This lists all the git commands in $PATH which is causing \"make test\" to\n> fail when I run it locally as it is testing all my local \"git-*\" scripts\n> most of which apparently fail this test. If there isn't already we\n> should add a option that lists the commands only in $GIT_EXEC_PATH and\n> use it here.\n\nThat should only happen if you set GIT_TEST_INSTALLED or something,\nright? Or maybe some even more exotic setup: even with my\ndistro-installed Git, the command doesn't list my git-* scripts in\n$PATH or installed extensions (like git-when-merged).\n\n> Also when I run the test with '-i' it does not stop at the first\n> failure. I'm not sure what's causing that as I thought\n> test_expect_success should exit on failure even when it is called in a loop.\n\nThat's odd: when I make some modifications that cause a failure and\nrun with \"-i,\" it does stop early. Hm.\n\nThanks for looking carefully! I'm personally having a hard time\nreproducing the issue though :/\n\n-- \nD. Ben Knoble\n"},{"id":"525199","messageId":"0548f4b2-6c36-4958-8725-5c9ac91e31e8@crinan.ddns.net","threadId":"63751","inReplyTo":"CALnO6CBbEB=94YsZn8vtjcwYENuMhMdg_wb2RbQunVCxnf53jQ@mail.gmail.com","subject":"Re: [PATCH v4 1/2] t/t1517: automate `git subcmd -h` tests outside a repository","fromName":"Phillip Wood","fromEmail":"phillip.wood123@gmail.com","sentAt":"2025-08-29T13:05:58Z","receivedAt":"2025-08-29T13:06:01Z","isPatch":true,"sender":{"key":"phillip.wood@dunelm.org.uk","avatar":null},"body":"Hi Ben\n\nOn 28/08/2025 14:47, D. Ben Knoble wrote:\n> On Tue, Aug 26, 2025 at 12:04 PM Phillip Wood <phillip.wood123@gmail.com> wrote:\n>>>\n>>> +for cmd in $(git --list-cmds=main)\n>>\n>> This lists all the git commands in $PATH which is causing \"make test\" to\n>> fail when I run it locally as it is testing all my local \"git-*\" scripts\n>> most of which apparently fail this test. If there isn't already we\n>> should add a option that lists the commands only in $GIT_EXEC_PATH and\n>> use it here.\n> \n> That should only happen if you set GIT_TEST_INSTALLED or something,\n> right? Or maybe some even more exotic setup: even with my\n> distro-installed Git, the command doesn't list my git-* scripts in\n> $PATH or installed extensions (like git-when-merged).\n\nSorry for the confusion, I've just had another look and it turns out I \nhad some rubbish laying around in the root of my repository which was \ncausing the problem.\n\n>> Also when I run the test with '-i' it does not stop at the first\n>> failure. I'm not sure what's causing that as I thought\n>> test_expect_success should exit on failure even when it is called in a loop.\n> \n> That's odd: when I make some modifications that cause a failure and\n> run with \"-i,\" it does stop early. Hm.\n> \n> Thanks for looking carefully! I'm personally having a hard time\n> reproducing the issue though :/\n\nHmm, I'm not sure what was happening, at the time it looked like the \nloop was continuing but I can't reproduce it either now.\n\nThanks for taking a look and sorry for the noise\n\nPhillip\n"},{"id":"525201","messageId":"CALnO6CBU0Y+JXdXsGgFR-XUMx=oheaQh3nEZpmidfwMxR6XYHQ@mail.gmail.com","threadId":"63751","inReplyTo":"0548f4b2-6c36-4958-8725-5c9ac91e31e8@crinan.ddns.net","subject":"Re: [PATCH v4 1/2] t/t1517: automate `git subcmd -h` tests outside a repository","fromName":"D. Ben Knoble","fromEmail":"ben.knoble@gmail.com","sentAt":"2025-08-29T13:22:39Z","receivedAt":"2025-08-29T13:22:53Z","isPatch":true,"sender":{"key":"ben.knoble@gmail.com","avatar":"https://avatars.githubusercontent.com/u/22802209?v=4"},"body":"On Fri, Aug 29, 2025 at 9:06 AM Phillip Wood <phillip.wood123@gmail.com> wrote:\n>\n> Hi Ben\n[snip]\n> Thanks for taking a look and sorry for the noise\n>\n> Phillip\n\nNo worries, glad it worked out!\n\n-- \nD. Ben Knoble\n"},{"id":"525219","messageId":"xmqqa53inl7y.fsf@gitster.g","threadId":"63751","inReplyTo":"0548f4b2-6c36-4958-8725-5c9ac91e31e8@crinan.ddns.net","subject":"Re: [PATCH v4 1/2] t/t1517: automate `git subcmd -h` tests outside a repository","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-08-29T16:31:13Z","receivedAt":"2025-08-29T16:31:17Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Phillip Wood <phillip.wood123@gmail.com> writes:\n\n>> That should only happen if you set GIT_TEST_INSTALLED or something,\n>> right? Or maybe some even more exotic setup: even with my\n>> distro-installed Git, the command doesn't list my git-* scripts in\n>> $PATH or installed extensions (like git-when-merged).\n>\n> Sorry for the confusion, I've just had another look and it turns out I\n> had some rubbish laying around in the root of my repository which was\n> causing the problem.\n\nI do not think this is something you should feel sorry about.\n\nIf you checked out and built 'seen' that invents new commands,\nand then checked out 'next' that lacks these new commands without\nfirst running \"make clean\" (relying on the mtime of the source will\ncause rebuilding of necessary things), your build on 'next' will \nsee \"some rubbish laying around\" that may cause the same issue, no?\n\nAs \"test\" is primarily to help developers, I think we should find a\nway for this test not to be confused by \"some rubbish laying around\"\nif possible.\n\nThanks.\n"},{"id":"525248","messageId":"CAPSxiM9g_dtxwavPUgyUHjn1qw9yc02=95NyWLyzAudCER80wg@mail.gmail.com","threadId":"63751","inReplyTo":"xmqqa53inl7y.fsf@gitster.g","subject":"Re: [PATCH v4 1/2] t/t1517: automate `git subcmd -h` tests outside a repository","fromName":"Usman Akinyemi","fromEmail":"usmanakinyemi202@gmail.com","sentAt":"2025-08-30T03:49:46Z","receivedAt":"2025-08-30T03:49:58Z","isPatch":true,"sender":{"key":"usmanakinyemi202@gmail.com","avatar":"https://avatars.githubusercontent.com/u/86585626?v=4"},"body":"Thanks all for this.\n"}]}