Re: [PATCH] git: avoid segfault on "git --shallow-file" without a value

Junio C Hamano <[email protected]>
Newsgroups org.kernel.vger.git
Message-ID <[email protected]>
Christian Couder <[email protected]> writes:

>> Just being
>> curious, because (1) if there are, this addition belongs there, not
>> here,
> ...
>> and (2) if there aren't, this addition may not be needed, and
>> (3) if there aren't or if the existing coverage is incomplete,
>> perhaps we should give a more complete coverage while at it.
>>
>> With (3), I mean something along the lines of ...
>>
>>         for opt in -C -c --git-dir --work-tree --namespace --config-env
>>         do
>>                 test_expect_success "git $opt without a value" '
>>                         test_must_fail git $opt >actual 2>error &&
>>                         test_line_count 0 actual &&
>>                         test_grep usage error
>>                 '
>>         done
>>
>> I do not mean to say that (3) is my favorite among these three,
>> though.
>
> I am fine with (2) or (3), but they don't seem much better to me than
> the test already in this patch.

I think this is the case between (1) and (2), there is not much
coverage, and there is no coverage specific to "git potty" options.

The 't0041' test is a suitable place if we eventually aim for more
complete coverage such as (3), instead of piecemeal tests, such as
'test --config option with other config-related things in t1300' and
'test --shallow-file option with other shallow-related things in
t????'.  So I think the patch is fine as-is.  I will just leave a
'#leftoverbits' comment here to remind others to consider whether it
is worth extending the test to cover more 'git potty' options for
completeness in the future.

Thanks.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.