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

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

From
Junio C Hamano <gitster@pobox.com>
Date
May 4, 2016, 22:06 UTC
Message-ID
<xmqqfutxeawm.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<CAGZ79kbUJjqYbY3hC1W0Aw=gR49i4Q0BjY+qM9aiWG5ME89Ruw@mail.gmail.com>
Stefan Beller <sbeller@google.com> writes:
Show 18 quoted lines
>> 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.

Previous: Stefan Beller
Message 17 of 17 in “submodule deinit: require '--all' instead of '.' for all submodules”
  1. submodule deinit: require '--all' instead of '.' for all submodulesStefan Beller, May 3, 2016
  2. Junio C HamanoMay 3, 2016
  3. Junio C HamanoMay 3, 2016
  4. Stefan BellerMay 3, 2016
  5. Junio C HamanoMay 3, 2016
  6. Stefan BellerMay 3, 2016
  7. [PATCHv2] submodule deinit: require '--all' instead of '.' for all submodulesStefan Beller, May 4, 2016
  8. Jonathan NiederMay 4, 2016
  9. [PATCHv3] submodule deinit: require '--all' instead of '.' for all submodulesStefan Beller, May 4, 2016
  10. Junio C HamanoMay 4, 2016
  11. Stefan BellerMay 4, 2016
  12. Junio C HamanoMay 4, 2016
  13. Stefan BellerMay 4, 2016
  14. Junio C HamanoMay 4, 2016
  15. Junio C HamanoMay 4, 2016
  16. Stefan BellerMay 4, 2016
  17. Junio C HamanoMay 4, 2016

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.