From: Stefan Beller <sbeller@google.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: Jens Lehmann <Jens.Lehmann@web.de>,
"git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: [PATCH 0/3] preparatory patches for the submodule groups
Date: Tue, 3 May 2016 14:57:00 -0700 [thread overview]
Message-ID: <CAGZ79kZK_EtwBps3hcYVkRat2XbpXXXdXkQDrB281rxkedjaGA@mail.gmail.com> (raw)
In-Reply-To: <xmqqfutylte1.fsf@gitster.mtv.corp.google.com>
On Tue, May 3, 2016 at 2:32 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Stefan Beller <sbeller@google.com> writes:
>
>>>> * I think we want to head for consistency, eventually.
>>>> e.g. commands with no arguments such as tag, branch
>>>> give a list of their respective domain.
>>>
>>> Isn't that a historical mistake we are regretting, though? Only
>>> after many other operation modes were invented and "create X" proves
>>> not to be the only primary modes we had to invent "tag -l" and
>>> "branch -l". Aren't we better off not having "no option means list"
>>> kind of default?
>>
>> listing is not destructive, and I really like to not type a single dash
>> for some commands.
>
> Actually, listing is destructive to the user's cognitive state.
Oh! I see.
>
> I wouldn't be surprised if many people wished that "git branch" did
> not list (and required "git branch -l" to list) to scroll everything
> they are looking away but instead showed what the current branch is.
Isn't that yet another more specialized mode of operation?
The difference being that showing the current branch is less lines of output
than showing all branches. (listing the branches could also be done similar
as `ls` lists files instead of `ls -1`)
>
>>>> Subcommands do not give lists by default, e.g.
>>>> `git stash clear`, `git remote prune`
>>>> which are the moral equivalent to
>>>> `git submodule deinit` just work as they were told, no --switch needed.
>>>
>>> I wouldn't say "git rm" should remove everything by extending that
>>> logic, but I can certainly buy if somebody argues "git submodule
>>> deinit" is not destructive enough to warrant extra safety.
>>
>> `git rm` is a command, not a subcommand though.
>
> Yes, it is a command, just like branch and tag you brought up.
>
> "git branch -d" is not a command, but a mode of operation. If we
> did the "mode word" UI [*1*], it would have been a subcommand. And
> I certainly would not say it should remove everything if there is no
> argument on the command line.
Right.
Another point of confusion is that the `submodule deinit` case
expects a path spec unlike all the other examples and path specs
have the notion for specifying "all of them" in different contexts, i.e.
'*' or '.' are valid "all path specs" in other programs.
We do not have a strong history for such "all of them" specifiers for
branches. (Well we could do a git branch -d refs/heads/* but these
are files actually, so we'd think of * as a natural character to do so)
There are no notions for "all of the stashes" (i.e. `git stash clear`
would be weird if it expected a '*'.
I think '--all' is the right thing to do here then.
>
> I am not sure where you are going with that though anyway.
I am trying to asses the users expectations on when you expect
a "safety" feature and when to expect the operation to perform.
>
> I think the "safety" is about forcing user to be more explicit when
> triggering mass destruction, and I do not think it matters if that
> destruction is done by a first-class subcommand of "git", or
> subsubcommand.
Ok. I thought it mattered a bit as a subsubcommand is already more
explicit than a command. Compare `git stash clear` to the
fictional `git clear` command. I would expect a `git clear`
to not delete critical things without arguments. Maybe some minor things
or internal things like garbage collection.
`clear` sounding similar to `clean`, we could have a "submodule.requireForce"
similar to clean.requireForce which would change the behavior of
submodule deinit and defaults to the safe version. (I do not know the
history of clean.requireForce but that sounds like it is a safety measure
added once people complained about having no safety default.)
But this discussion strengthens my opinion that we should just have a switch
for deinit.
Thanks,
Stefan
>
>
> [References]
>
> *1* http://thread.gmane.org/gmane.comp.version-control.git/231376/focus=231478
next prev parent reply other threads:[~2016-05-03 21:57 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-02 22:24 [PATCH 0/3] preparatory patches for the submodule groups Stefan Beller
2016-05-02 22:24 ` [PATCH 1/3] submodule deinit test: fix broken && chain in subshell Stefan Beller
2016-05-03 16:19 ` Junio C Hamano
2016-05-03 19:30 ` Stefan Beller
2016-05-02 22:24 ` [PATCH 2/3] submodule deinit: lose requirement for giving '.' Stefan Beller
2016-05-03 17:21 ` Junio C Hamano
2016-05-03 18:07 ` Stefan Beller
2016-05-03 19:08 ` Junio C Hamano
2016-05-03 19:22 ` Stefan Beller
2016-05-02 22:24 ` [PATCH 3/3] submodule init: redirect stdout to stderr Stefan Beller
2016-05-03 20:27 ` [PATCH 0/3] preparatory patches for the submodule groups Junio C Hamano
2016-05-03 20:53 ` Stefan Beller
2016-05-03 21:01 ` Junio C Hamano
2016-05-03 21:12 ` Stefan Beller
2016-05-03 21:32 ` Junio C Hamano
2016-05-03 21:57 ` Stefan Beller [this message]
2016-05-03 22:24 ` 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAGZ79kZK_EtwBps3hcYVkRat2XbpXXXdXkQDrB281rxkedjaGA@mail.gmail.com \
--to=sbeller@google.com \
--cc=Jens.Lehmann@web.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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.
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 NNTP newsgroup(s).