Subject: Re: [PATCH] tab completion of filenames for 'git restore'

From: Junio C Hamano <[email-masked]>
Date: Tue, 15 Mar 2022 03:23:51 -0700

David Cantrell <[email-masked]> writes:

>>> @@ -2883,14 +2883,21 @@ _git_restore ()
>>>   	case "$cur" in
>>>   	--conflict=*)
>>>   		__gitcomp "diff3 merge zdiff3" "" "${cur##--conflict=}"
>>> +		return
>>>   		;;
>>>   	--source=*)
>>>   		__git_complete_refs --cur="${cur##--source=}"
>>> +		return
>>>   		;;
>>> ...
>> Do you need to sprinkle return's?  Instead you could just add
>> another case arm, like
>> +	*)
>> +		... whatever you want to do when
>> +		... $cur is not a --dashed-option
>> +		;;
>
> Liberal sprinkling of return like that seems to be the norm for the
> rest of the file so I stuck with it.

An existing bad practice is not a good excuse to spread it even
more, though.