git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: submodule: if $command was not matched, don't parse other args

From
Junio C Hamano <gitster@pobox.com>
Date
Sep 24, 2012, 16:17 UTC
Message-ID
<7v7grj1jkr.fsf@alter.siamese.dyndns.org>
In-Reply-To
<50607748.6000204@xiplink.com>
Marc Branchaud <mbranchaud@xiplink.com> writes:
Show 40 quoted lines
> On 12-09-23 01:36 PM, Jens Lehmann wrote:
>> Am 22.09.2012 22:31, schrieb Junio C Hamano:
>>> Ramkumar Ramachandra <artagnon@gmail.com> writes:
>>>> diff --git a/git-submodule.sh b/git-submodule.sh
>>>> index a7e933e..dfec45d 100755
>>>> --- a/git-submodule.sh
>>>> +++ b/git-submodule.sh
>>>> @@ -1108,7 +1108,15 @@ do
>>>>  done
>>>>
>>>>  # No command word defaults to "status"
>>>> -test -n "$command" || command=status
>>>> +if test -z "$command"
>>>> +then
>>>> +    if test $# = 0
>>>> +    then
>>>> +	command=status
>>>> +    else
>>>> +	usage
>>>> +    fi
>>>> +fi
>>>
>>> I personally feel "no command means this default" is a mistake for
>>> "git submodule", even if there is no pathspec or other arguments,
>>> but I am not a heavy user of submodules, so others should discuss
>>> this.
>> 
>> ... but I'd rather tend to not change that
>> behavior which has been there from day one for backward compatibility
>> reasons. But if many others see that as an improvement too I won't
>> object against changing it the way Ramkumar proposes (but he'd have
>> to change the documentation too ;-).
>> 
>> Since diff and status learned to display submodule status information
>> (except for a submodule being uninitialized) I almost never use this
>> option myself, so I'd be interested to hear what submodule users who
>> do use "git submodule [status]" frequently think.
>
> I also almost never use "git submodule [status]", and I also agree that
> git-submodule shouldn't have a default sub-command.

OK, I do not think Ramkumar's patch hurts anybody, but dropping the "nothing on the command line defaults to 'status' action" could. So let's queue the patch as-is at least for now and leave the default discussion to a separarte thread if needed.

Thanks.
Previous: Marc BranchaudNext: Ramkumar Ramachandra
Message 5 of 8 in “submodule: if $command was not matched, don't parse other args”
  1. Ramkumar RamachandraSep 22, 2012
  2. Junio C HamanoSep 22, 2012
  3. Jens LehmannSep 23, 2012
  4. Marc BranchaudSep 24, 2012
  5. Junio C HamanoSep 24, 2012
  6. Ramkumar RamachandraSep 24, 2012
  7. Junio C HamanoSep 24, 2012
  8. Ramkumar RamachandraSep 24, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.