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

Re: [PATCH v2 3/3] submodule: document default behavior

From
Denton Liu <liu.denton@gmail.com>
Date
Feb 14, 2019, 07:24 UTC
Message-ID
<20190214072405.GA24259@archbookpro.localdomain>
In-Reply-To
<xmqqzhqzbki3.fsf@gitster-ct.c.googlers.com>
On Wed, Feb 13, 2019 at 10:39:48AM -0800, Junio C Hamano wrote:
Show 33 quoted lines
> Denton Liu <liu.denton@gmail.com> writes:
> > diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt
> > index 65a952fb96..2fdf9f4cf3 100644
> > --- a/Documentation/git-submodule.txt
> > +++ b/Documentation/git-submodule.txt
> > @@ -9,6 +9,7 @@ git-submodule - Initialize, update or inspect submodules
> >  SYNOPSIS
> >  --------
> >  [verse]
> > +'git submodule' [--quiet] [--cached]
> >  'git submodule' [--quiet] 'add' [<options>] [--] <repository> [<path>]
> >  'git submodule' [--quiet] 'status' [--cached] [--recursive] [--] [<path>...]
> >  'git submodule' [--quiet] 'init' [--] [<path>...]
> > @@ -28,6 +29,9 @@ For more information about submodules, see linkgit:gitsubmodules[7].
> >
> >  COMMANDS
> >  --------
> > +With no arguments, the default command is 'status'.  Several subcommands are
> > +available to perform operations on the submodules.
>
> I am not sure if "default is status" is really true.
>
>    $ git submodule status --recursive
>    $ git submodule --recursive
>    usage: git submodule [--quiet] ...
>       or: ...
>    $ git submodule -- sha1collisiondetection
>    usage: git submodule [--quiet] ...
>       or: ...
>
> If 'status' were truly the default, wouldn't the form without any
> subcommand take any option and parameter the 'status' subcommand
> would accept?

This is very similar to git-remote. Its default command is 'show' but doing something like 'git remote -n' fails, even though 'git remote show -n' succeeds.

Would it make sense to revise this back to
	With no arguments, shows the status of existing submodules.

which was the phrasing I used in v1? (If this is the case, I'd also like to drop the first patch of this series.)

Thanks,
Denton
Previous: Junio C HamanoNext: Junio C Hamano
Message 11 of 14 in “git-submodule.txt: document default behavior”
  1. git-submodule.txt: document default behaviorDenton Liu, Feb 12, 2019
  2. Duy NguyenFeb 12, 2019
  3. 0/3 Document git-submodule's default behaviorDenton Liu, Feb 12, 2019
  4. 1/3 git-remote.txt: be specific about default behaviorDenton Liu, Feb 12, 2019
  5. 2/3 git-submodule.txt: make subcommands underlinedDenton Liu, Feb 12, 2019
  6. Denton LiuFeb 13, 2019
  7. Duy NguyenFeb 13, 2019
  8. Junio C HamanoFeb 13, 2019
  9. 3/3 submodule: document default behaviorDenton Liu, Feb 12, 2019
  10. Junio C HamanoFeb 13, 2019
  11. Denton LiuFeb 14, 2019
  12. Junio C HamanoFeb 14, 2019
  13. 0/1 Document git-submodule's default behaviorDenton Liu, Feb 15, 2019
  14. 1/1 submodule: document default behaviorDenton Liu, Feb 15, 2019

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.