Re: [PATCH v4 1/2] t/t1517: automate `git subcmd -h` tests outside a repository

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"D. Ben Knoble" <ben.knoble@xxxxxxxxx> writes:

>> +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.

>> +       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?

;-)




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux