git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Owen Taylor <otaylor@redhat.com>
To: Rob Barrett <barrettboy@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Usability question
Date: Thu, 17 Sep 2009 07:20:20 -0400	[thread overview]
Message-ID: <1253186420.11581.380.camel@localhost.localdomain> (raw)
In-Reply-To: <513ca40e0909170301s2b09184akb27acde76975c09b@mail.gmail.com>

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

      parent reply	other threads:[~2009-09-17 11:20 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]

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=1253186420.11581.380.camel@localhost.localdomain \
    --to=otaylor@redhat.com \
    --cc=barrettboy@gmail.com \
    --cc=git@vger.kernel.org \
    /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).