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, 18:45 UTC
Message-ID
<7vbogvz2d9.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CALkWK0mpDp652Hmgx2-KCw+SdFmFKHMLAOya=vRy-fsV_YH4MQ@mail.gmail.com>
Ramkumar Ramachandra <artagnon@gmail.com> writes:
Show 9 quoted lines
> Junio C Hamano wrote:
>> 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.
>
> Please don't do that, because it breaks test 41 in
> t7400-submodule-bash.  I'll add a hunk to remove the test and send a
> patch tomorrow.

I personally see no need waiting for something trivial like this. Isn't it sufficient to squash the following in? Is anything else needed?

 Documentation/git-submodule.txt | 1 -
 t/t7400-submodule-basic.sh      | 4 ++--
 2 files changed, 2 insertions(+), 3 deletions(-)
diff --git i/Documentation/git-submodule.txt w/Documentation/git-submodule.txt
index 2de7bf0..b4683bb 100644
--- i/Documentation/git-submodule.txt
+++ w/Documentation/git-submodule.txt
@@ -112,7 +112,6 @@ status::
 	initialized, `+` if the currently checked out submodule commit
 	does not match the SHA-1 found in the index of the containing
 	repository and `U` if the submodule has merge conflicts.
-	This command is the default command for 'git submodule'.
 +
 If `--recursive` is specified, this command will recurse into nested
 submodules, and show their status as well.
diff --git i/t/t7400-submodule-basic.sh w/t/t7400-submodule-basic.sh
index 0278f48..442dc44 100755
--- i/t/t7400-submodule-basic.sh
+++ w/t/t7400-submodule-basic.sh
@@ -438,8 +438,8 @@ test_expect_success 'moving to a commit without submodule does not leave empty d
 	git checkout second
 '
 
-test_expect_success 'submodule <invalid-path> warns' '
-	test_failure_with_unknown_submodule
+test_expect_success 'submodule <invalid-subcommand> fails' '
+	test_must_fail git submodule no-such-subcommand
 '
 
 test_expect_success 'add submodules without specifying an explicit path' '
Previous: Ramkumar RamachandraNext: Ramkumar Ramachandra
Message 7 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.