Subject: Re: [PATCHv3] submodule deinit: require '--all' instead of '.' for all submodules

From: Junio C Hamano <[email-masked]>
Date: Wed, 04 May 2016 15:06:01 -0700

Stefan Beller <[email-masked]> writes:

>> IOW, the latter part _might_ be better if it were
>>
>>         if test $# = 0 && test -z "$deinit_all"
>>         then
>>                 echo >&2 "info: not deinitializing anything."
>>                 echo >&2 "info: Use --all to deinitialize all submodules."
>>                 exit 0
>>         fi
>>
>> given that this is really about preventing mistakes from doing mass
>> destruction.
>  ...
> Maybe:
>
>> -             die "$(eval_gettext "Use '.' if you really want to deinitialize all submodules")"
>> +            usage()
>
> instead?

I was primarily concerned about die giving a non-zero exit status
when "git submodule deinit" did not find anything worthwhile to do
(because we specified nothing on the command line to deinit).  IOW,
it was an attempt to do "You asked me a no-op, so I am doing a
no-op, but if I stayed silent, you wouldn't even notice it, and you
might have meant to deinit all, so I am telling you I didn't do
anything, and advising how to say 'deinit all' to me."

But what we see in the patch under discussion is perfectly fine; it
behaves just like "$ rm<RET>" and "$ git add<RET>" that give an
error message and exit with a non-zero status.