git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Felipe Contreras <felipe.contreras@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] config: Add new option to open an editor.
Date: Wed, 4 Feb 2009 10:18:33 -0500	[thread overview]
Message-ID: <20090204151833.GA6896@sigill.intra.peff.net> (raw)
In-Reply-To: <94a0d4530902040703u53a9082fsfa7203b6203bd118@mail.gmail.com>

On Wed, Feb 04, 2009 at 05:03:22PM +0200, Felipe Contreras wrote:

> > With this patch, won't I get different behavior from:
> >
> >  git config -e --global
> >
> > versus
> >
> >  git config --global -e
> 
> Just like you get different behavior from:
> 
> git config -l --global
> 
> and
> 
> git config --global -l

Ugh. Personally I consider such interfaces poorly designed. I understand
that the general way "git config" works is to have "git config [options]
[action]". And when "[action]" is a variable name, or a variable name
with a value, it is easy to see what's going on. But when the action
looks like an option, it is just confusing that their ordering is
important.

However, the interface to "git config" is not going to change, so I
think your following existing practice is reasonable here.

_But_ there is one important difference between your "-e" and "-l". In
the "-l" case, we detect that there is extra trailing cruft that will be
ignored and give a usage message.  So "git config -l --global"
complains, but "git config -e --global" silently ignores the second
argument. I think you just need to add

  if (argc != 2)
    usage(git_config_set_usage);

as the "-l" code does.

-Peff

  reply	other threads:[~2009-02-04 15:20 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-03 22:40 [PATCH] config: Add new option to open an editor Felipe Contreras
2009-02-03 22:53 ` Johannes Schindelin
2009-02-03 22:56   ` Felipe Contreras
2009-02-03 23:05     ` Johannes Schindelin
2009-02-03 23:25       ` Felipe Contreras
2009-02-03 23:26         ` Felipe Contreras
2009-02-03 23:31         ` Johannes Schindelin
2009-02-03 23:43           ` Felipe Contreras
2009-02-04 14:53 ` Jeff King
2009-02-04 15:03   ` Felipe Contreras
2009-02-04 15:18     ` Jeff King [this message]
2009-02-04 15:41       ` Felipe Contreras
2009-02-04 22:34         ` [PATCH v3] " Felipe Contreras
2009-02-04 23:16           ` Junio C Hamano
2009-02-04 23:39             ` Felipe Contreras
2009-02-04 23:43             ` Johannes Schindelin
2009-02-04 23:49               ` Johannes Schindelin
2009-02-07 21:09                 ` Felipe Contreras
2009-02-07 21:14                   ` Johannes Schindelin
2009-02-07 21:15                     ` Felipe Contreras
2009-02-07 21:34                       ` Junio C Hamano
2009-02-07 21:50                         ` Felipe Contreras
2009-02-07 21:53                           ` [PATCH] " Felipe Contreras
2009-02-04 15:20     ` Johannes Schindelin
2009-02-04 15:42       ` Felipe Contreras

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=20090204151833.GA6896@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=felipe.contreras@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.
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).