git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Usability question
@ 2009-09-17 10:01 Rob Barrett
  2009-09-17 10:41 ` Matthieu Moy
  2009-09-17 11:20 ` Owen Taylor
  0 siblings, 2 replies; 8+ messages in thread
From: Rob Barrett @ 2009-09-17 10:01 UTC (permalink / raw)
  To: git

When starting with git people almost always ask some variant of "how
do I know whether this option should be prefixed with dashes or not?"
i.e. git reset --hard vs. git stash save --patch, which coupled with
other path, sha and treeish args make things a bit more confusing.

Not sure if this has been discussed before? If it has point me at the
discussion and I'll go look at it -- no need to read further.

And people stop asking the question after they get used to git - but
that's not the same as being usable.

Out of 60+ commands, most take the form
git <subcommand> [--option]
and a few take the form
git <subcommand> subsubcommand [--option]

(a quick scan gives: bisect,bundle,reflog,remote,stash)

My questions:
1. What is the distinction that makes the 10% special enough to get
non-prefixed options?
2. Is it worthwhile? Wouldn't it be better if to shoot for more
consistency / less complexity?

Rob

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Usability question
  2009-09-17 10:01 Usability question Rob Barrett
@ 2009-09-17 10:41 ` Matthieu Moy
  2009-09-17 12:13   ` SZEDER Gábor
                     ` (2 more replies)
  2009-09-17 11:20 ` Owen Taylor
  1 sibling, 3 replies; 8+ messages in thread
From: Matthieu Moy @ 2009-09-17 10:41 UTC (permalink / raw)
  To: Rob Barrett; +Cc: git

Rob Barrett <barrettboy@gmail.com> writes:

> My questions:
> 1. What is the distinction that makes the 10% special enough to get
> non-prefixed options?

Prefixed and non-prefixed is what people usually call respectively
"options" and "subcommands". To me, the distinction is needed:

Options are flags that modify the behavior of a git command. For
example, "git reset" and "git reset --hard" do something similar, but
"git svn rebase" and "git svn dcommit" do something really, totally
different. It's not about doing the same thing in a different way,
it's really about different actions.

Subcommands are closer to commands than they are to options. The
reason to group several subcommands into one command is mostly to
reduce the number of commands, but for example, it could have been
decided to replace "git svn dcommit" by "git svn-dcommit" (but then
"git help" would have been really really scarry).

> 2. Is it worthwhile? Wouldn't it be better if to shoot for more
> consistency / less complexity?

Well, if you want to get rid of subcommands, why not get rid of
commands, too?

git --commit
git --status
git --svn --rebase

I find the distinction between commands, subcommands and options
really helpfull.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Usability question
  2009-09-17 10:01 Usability question Rob Barrett
  2009-09-17 10:41 ` Matthieu Moy
@ 2009-09-17 11:20 ` Owen Taylor
  1 sibling, 0 replies; 8+ messages in thread
From: Owen Taylor @ 2009-09-17 11:20 UTC (permalink / raw)
  To: Rob Barrett; +Cc: git

On Thu, 2009-09-17 at 20:01 +1000, Rob Barrett wrote:
> When starting with git people almost always ask some variant of "how
> do I know whether this option should be prefixed with dashes or not?"
> i.e. git reset --hard vs. git stash save --patch, which coupled with
> other path, sha and treeish args make things a bit more confusing.
> 
> Not sure if this has been discussed before? If it has point me at the
> discussion and I'll go look at it -- no need to read further.
> 
> And people stop asking the question after they get used to git - but
> that's not the same as being usable.
> 
> Out of 60+ commands, most take the form
> git <subcommand> [--option]
> and a few take the form
> git <subcommand> subsubcommand [--option]
> 
> (a quick scan gives: bisect,bundle,reflog,remote,stash)
> 
> My questions:
> 1. What is the distinction that makes the 10% special enough to get
> non-prefixed options?
> 2. Is it worthwhile? Wouldn't it be better if to shoot for more
> consistency / less complexity?

I don't think anybody is going to say that it all makes perfect sense. 
One pattern is:

 git <verb>

vs.

 git <subsystem> <verb>  (gui, svn, ...)
 git <noun> <verb>       (bundle, remote, stash, submodule, ...)

Another pattern is that options don't change the verb, they just 
modify it. 

But it's easy to find exceptions:

 git tag -l
 git branch --contains <commit>
 git am --abort

I personally think it would help consistency to use the subsubcommand
pattern more and treat 'git tag <tag>' as an shorthand. If you really
want to to create a tag called 'list', you'd need to use
'git tag tag list', or maybe 'git tag -- list'.

Even with compat support for options and a general agreement that I
doubt exists, that's at best a 95% compatible change, so it's unlikely
to happen soon.

- Owen

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Usability question
  2009-09-17 10:41 ` Matthieu Moy
@ 2009-09-17 12:13   ` SZEDER Gábor
  2009-09-17 13:09     ` Matthieu Moy
  2009-09-17 13:25   ` Daniele Segato
  2009-09-20  2:21   ` Rob Barrett
  2 siblings, 1 reply; 8+ messages in thread
From: SZEDER Gábor @ 2009-09-17 12:13 UTC (permalink / raw)
  To: Matthieu Moy; +Cc: Rob Barrett, git

Hi,


On Thu, Sep 17, 2009 at 12:41:06PM +0200, Matthieu Moy wrote:
> Rob Barrett <barrettboy@gmail.com> writes:
> > 1. What is the distinction that makes the 10% special enough to get
> > non-prefixed options?
> 
> Prefixed and non-prefixed is what people usually call respectively
> "options" and "subcommands". To me, the distinction is needed:
> 
> Options are flags that modify the behavior of a git command. For
> example, "git reset" and "git reset --hard" do something similar, but
> "git svn rebase" and "git svn dcommit" do something really, totally
> different. It's not about doing the same thing in a different way,
> it's really about different actions.

I tend to aggree, but what about 'git rebase --abort' vs. 'git rebase
--continue'?  IMHO they are also doing something totally different.


Best,
Gábor

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Usability question
  2009-09-17 12:13   ` SZEDER Gábor
@ 2009-09-17 13:09     ` Matthieu Moy
  0 siblings, 0 replies; 8+ messages in thread
From: Matthieu Moy @ 2009-09-17 13:09 UTC (permalink / raw)
  To: SZEDER Gábor; +Cc: Rob Barrett, git

SZEDER Gábor <szeder@ira.uka.de> writes:

> I tend to aggree, but what about 'git rebase --abort' vs. 'git rebase
> --continue'?  IMHO they are also doing something totally different.

If I were to rewrite it, I'd call them "git rebase abort" without
dashes. Not sure renaming them to subcommands is worth it though.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Usability question
  2009-09-17 10:41 ` Matthieu Moy
  2009-09-17 12:13   ` SZEDER Gábor
@ 2009-09-17 13:25   ` Daniele Segato
  2009-09-20  2:21   ` Rob Barrett
  2 siblings, 0 replies; 8+ messages in thread
From: Daniele Segato @ 2009-09-17 13:25 UTC (permalink / raw)
  To: Matthieu Moy; +Cc: Rob Barrett, git

On Thu, Sep 17, 2009 at 12:01 PM, Rob Barrett <barrettboy@gmail.com> wrote:
> When starting with git people almost always ask some variant of "how
> do I know whether this option should be prefixed with dashes or not?"
> i.e. git reset --hard vs. git stash save --patch, which coupled with
> other path, sha and treeish args make things a bit more confusing.

> And people stop asking the question after they get used to git - but
> that's not the same as being usable.

without speaking of usability I'll tell them to use autocompletion to
see which command / options they have until
they get used to them

regards,
Daniele

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Usability question
  2009-09-17 10:41 ` Matthieu Moy
  2009-09-17 12:13   ` SZEDER Gábor
  2009-09-17 13:25   ` Daniele Segato
@ 2009-09-20  2:21   ` Rob Barrett
  2009-09-20 18:54     ` Dmitry Potapov
  2 siblings, 1 reply; 8+ messages in thread
From: Rob Barrett @ 2009-09-20  2:21 UTC (permalink / raw)
  To: Matthieu Moy; +Cc: git

On Thu, Sep 17, 2009 at 8:41 PM, Matthieu Moy
<Matthieu.Moy@grenoble-inp.fr> wrote:
> Well, if you want to get rid of subcommands, why not get rid of
> commands, too?
>
> git --commit
> git --status
> git --svn --rebase
>

Well, granted, that's a sort of heavyweight consistency, but all we
should need to do is to help reduce a _new_ user's confusion about
when the word after a subcommand gets a '--' prefix and when it
doesn't.

And do it in a way that's backwards compatible so it doesn't affect
the usage patterns of seasoned users, existing scripts, crons etc.

Will patch and see how it looks..

Rob

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Usability question
  2009-09-20  2:21   ` Rob Barrett
@ 2009-09-20 18:54     ` Dmitry Potapov
  0 siblings, 0 replies; 8+ messages in thread
From: Dmitry Potapov @ 2009-09-20 18:54 UTC (permalink / raw)
  To: Rob Barrett; +Cc: Matthieu Moy, git

On Sun, Sep 20, 2009 at 12:21:38PM +1000, Rob Barrett wrote:
> On Thu, Sep 17, 2009 at 8:41 PM, Matthieu Moy
> <Matthieu.Moy@grenoble-inp.fr> wrote:
> > Well, if you want to get rid of subcommands, why not get rid of
> > commands, too?
> >
> > git --commit
> > git --status
> > git --svn --rebase
> >
> 
> Well, granted, that's a sort of heavyweight consistency, but all we
> should need to do is to help reduce a _new_ user's confusion about
> when the word after a subcommand gets a '--' prefix and when it
> doesn't.
> 
> And do it in a way that's backwards compatible so it doesn't affect
> the usage patterns of seasoned users, existing scripts, crons etc.
> 
> Will patch and see how it looks..

It will be horrible broken... Do you realize that there is a bigger
difference between commands and options than just that commands are
written without a '--' prefix? Take a look at the following commands:

$ git -p log
$ git log -p

There are completely difference because in the former case the -p
option modifies 'git' behavior while in the later case 'git log'.

If you change commands to options, you are going to break everything.


Dmitry

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-09-20 18:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-17 10:01 Usability question Rob Barrett
2009-09-17 10:41 ` Matthieu Moy
2009-09-17 12:13   ` SZEDER Gábor
2009-09-17 13:09     ` Matthieu Moy
2009-09-17 13:25   ` Daniele Segato
2009-09-20  2:21   ` Rob Barrett
2009-09-20 18:54     ` Dmitry Potapov
2009-09-17 11:20 ` Owen Taylor

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).