Re: [PATCH v4 1/2] t/t1517: automate `git subcmd -h` tests outside a repository
- From
D. Ben Knoble <ben.knoble@gmail.com>
- Date
- Aug 28, 2025, 13:47 UTC
- Message-ID
- <CALnO6CBbEB=94YsZn8vtjcwYENuMhMdg_wb2RbQunVCxnf53jQ@mail.gmail.com>
- In-Reply-To
- <370f11e1-b335-4111-912c-94429c5018d6@gmail.com>
On Tue, Aug 26, 2025 at 12:04 PM Phillip Wood <phillip.wood123@gmail.com> wrote:
Show 24 quoted lines
> > Hi Usman > > On 21/07/2025 12:55, Usman Akinyemi wrote: > > > > diff --git a/t/t1517-outside-repo.sh b/t/t1517-outside-repo.sh > > index 6824581317..9fcebb7d94 100755 > > --- a/t/t1517-outside-repo.sh > > +++ b/t/t1517-outside-repo.sh > > @@ -110,8 +110,29 @@ test_expect_success LIBCURL 'remote-http outside repository' ' > > test_expect_success 'update-server-info does not crash with -h' ' > > test_expect_code 129 git update-server-info -h >usage && > > test_grep "[Uu]sage: git update-server-info " usage && > > - test_expect_code 129 nongit git update-server-info -h >usage && > > - test_grep "[Uu]sage: git update-server-info " usage > > ' > > > > +for cmd in $(git --list-cmds=main) > > This lists all the git commands in $PATH which is causing "make test" to > fail when I run it locally as it is testing all my local "git-*" scripts > most of which apparently fail this test. If there isn't already we > should add a option that lists the commands only in $GIT_EXEC_PATH and > use it here.
That should only happen if you set GIT_TEST_INSTALLED or something, right? Or maybe some even more exotic setup: even with my distro-installed Git, the command doesn't list my git-* scripts in $PATH or installed extensions (like git-when-merged).
> Also when I run the test with '-i' it does not stop at the first > failure. I'm not sure what's causing that as I thought > test_expect_success should exit on failure even when it is called in a loop.
That's odd: when I make some modifications that cause a failure and run with "-i," it does stop early. Hm.
Thanks for looking carefully! I'm personally having a hard time reproducing the issue though :/
-- D. Ben Knoble