From: Stefan Beller <sbeller@google.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Jonathan Nieder <jrnieder@gmail.com>,
"git@vger.kernel.org" <git@vger.kernel.org>,
Jens Lehmann <Jens.Lehmann@web.de>
Subject: Re: [PATCHv3] submodule deinit: require '--all' instead of '.' for all submodules
Date: Wed, 4 May 2016 14:57:59 -0700 [thread overview]
Message-ID: <CAGZ79kbUJjqYbY3hC1W0Aw=gR49i4Q0BjY+qM9aiWG5ME89Ruw@mail.gmail.com> (raw)
In-Reply-To: <xmqqshxxeboj.fsf@gitster.mtv.corp.google.com>
On Wed, May 4, 2016 at 2:49 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Junio C Hamano <gitster@pobox.com> writes:
>
>>> + if test -n "$deinit_all" && test "$#" -ne 0
>>> + then
>>> + die "$(eval_gettext "usage: $dashless [--quiet] deinit [-f|--force] (--all | [--] <path>...)")"
>>
>> I doubt that "usage:" wants to go thru l10n.
>>
>> I suspect that it is more friendly to the user to say that in prose,
>> i.e.e.g. "--all and pathspec cannot be given at the same time", than
>> forcing them to grok the (alternative|possibilities).
>>
>>> + fi
>>> + if test $# = 0 && test -z "$deinit_all"
>>> then
>>> - die "$(eval_gettext "Use '.' if you really want to deinitialize all submodules")"
>>> + die "$(eval_gettext "Use '--all' if you really want to deinitialize all submodules")"
>>> fi
>>
>> This is good.
>
> By the way, while it is a very good idea to die upon
>
> $ git submodule deinit --all no-only-this-one
>
> it may not be too bad if we demoted the output to "info" with clean
> no-op exit when the user said
>
> $ git submodule deinit
>
> 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.
Demote to a new class in a class of its own?
* grep -r "info:" gives no match for user facing code, so it's a
prefix you made up now.
* I assume we want to translate it?
* This would not respect the --quiet option?
* returning 0 as in "everyting is fine", while nothing is fine.
There are two cases:
- Either the user knows what they are doing (See Per complaining
about this)
A very deliberate "I want it all gone or error out if you
cannot remove it all"
- The user has no idea what they are doing. Exiting non zero
doesn't do any harm.
Maybe:
> - die "$(eval_gettext "Use '.' if you really want to deinitialize all submodules")"
> + usage()
instead?
next prev parent reply other threads:[~2016-05-04 21:58 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-03 22:11 [PATCH] submodule deinit: require '--all' instead of '.' for all submodules Stefan Beller
2016-05-03 22:25 ` Junio C Hamano
2016-05-03 22:28 ` Junio C Hamano
2016-05-03 22:43 ` Stefan Beller
2016-05-03 22:52 ` Junio C Hamano
2016-05-03 23:02 ` Stefan Beller
2016-05-04 0:33 ` [PATCHv2] " Stefan Beller
2016-05-04 0:47 ` Jonathan Nieder
2016-05-04 1:19 ` [PATCHv3] " Stefan Beller
2016-05-04 20:44 ` Junio C Hamano
2016-05-04 21:34 ` Stefan Beller
2016-05-04 21:43 ` Junio C Hamano
2016-05-04 21:47 ` Stefan Beller
2016-05-04 21:51 ` Junio C Hamano
2016-05-04 21:49 ` Junio C Hamano
2016-05-04 21:57 ` Stefan Beller [this message]
2016-05-04 22:06 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAGZ79kbUJjqYbY3hC1W0Aw=gR49i4Q0BjY+qM9aiWG5ME89Ruw@mail.gmail.com' \
--to=sbeller@google.com \
--cc=Jens.Lehmann@web.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jrnieder@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).