Re: [PATCH v4 1/2] t/t1517: automate `git subcmd -h` tests outside a repository
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 28, 2025, 15:08 UTC
- Message-ID
- <xmqqzfcoxshr.fsf@gitster.g>
- In-Reply-To
- <CALnO6CCN0HUXJVYmvAJO3EoQQZzHVjE0P=g+AUc9c5Ti0Rcm2w@mail.gmail.com>
"D. Ben Knoble" <ben.knoble@gmail.com> writes:
Show 17 quoted lines
>> +for cmd in $(git --list-cmds=main)
>> +do
>> + cmd=${cmd%.*} # strip .sh, .perl, etc.
>> + case "$cmd" in
>> + archimport | cvsexportcommit | cvsimport | cvsserver | daemon | \
>> + difftool--helper | filter-branch | fsck-objects | get-tar-commit-id | \
>> + http-backend | http-fetch | http-push | init-db | instaweb.sh | \
>> + merge-octopus | merge-one-file | merge-resolve | mergetool | \
>> + mktag | p4 | p4.py | pickaxe | quiltimport | remote-ftp | remote-ftps | \
>
> Hm—if we strip the suffix with ${cmd%.*}, do we need a p4.py
> pattern too? Actually, at first I wondered why we need to strip
> the suffix at all. My local Git produces only unsuffixed commands.
> ...
> bin-wrappers/git produces both p4 and p4.py; request-pull and
> request-pull.sh; and several others. So I think stripping is probably
> right, just drop the .py pattern.Ahh, OK, I didn't realize that bin-wrappers gets into the picture. So you're right. Fixing the bin-wrappers may be necessary, but dropping the extra ones is certainly a good idea.
Show 6 quoted lines
>> + test_$expect_outcome "'git $cmd -h' outside a repository" ' >> + test_expect_code 129 nongit git $cmd -h >usage && >> + echo "Hello" && > > Woops! While basing some work on this branch, I spotted this "echo"—I > assume it's leftover and didn't mean to be included here?
;-)