Thread (15 messages) flat view 15 messages, 3 authors, 2016-06-15

Re: [PATCH] config: Add new option to open an editor.

From: Jeff King <hidden>
Date: 2016-06-15 22:46:05

On Wed, Feb 04, 2009 at 05:03:22PM +0200, Felipe Contreras wrote:
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help