git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: David Pisoni <dpisoni@gmail.com>
Cc: Michael J Gruber <drmicha@warpmail.net>,
	Michael J Gruber <git@drmicha.warpmail.net>,
	GIt Mailing List <git@vger.kernel.org>,
	Git Maintainer <gitster@pobox.com>
Subject: Re: RFC proposal: set git defaults options from config
Date: Mon, 16 May 2011 07:05:45 -0400	[thread overview]
Message-ID: <20110516110545.GC23889@sigill.intra.peff.net> (raw)
In-Reply-To: <2235D93D-4F02-42D7-88B1-74F692D58AA5@gmail.com>

On Thu, May 12, 2011 at 03:36:16PM -0700, David Pisoni wrote:

> This has some interesting implications.  Consider the case at hand:
> git-stash --index is a boolean switch.  It was not the default state,
> and it lacked any configuration override, so there was no
> '--no-index' switch provided.  If we make this change to git,
> presumably EVERY boolean flag like this in all the git subcommands
> needs to be backed with a '--no' counterpart.

Most of them already are, by virtue of parse-options. And I don't
think it's a bad thing for those that don't have one to get one.

> Thinking this through a little further, there is the potential to
> want to override the configured value (in the case of non-booleans)
> with an explicit command line switch.  So now we have "precedence
> rules" for subcommand options. Probably simple to handle this for
> single vars, but harder for multivars.

For single vars, which are most of it, it is pretty simple. For
multivars, mostly "--no-$option" should reset the multivar list
explicitly. I expect there are some oddballs where that is not the case,
though. For example, we just recently found some confusion with
resetting "git status" to its default after seeing "--porcelain".
So there would probably be some cleanup work there.

-Peff

  reply	other threads:[~2011-05-16 11:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-11 22:57 [PATCH] Adds 'stash.index' configuration option David Pisoni
2011-05-11 23:46 ` Junio C Hamano
2011-05-12  0:26   ` Junio C Hamano
2011-05-12  0:48     ` David Pisoni
2011-05-12  0:54       ` Junio C Hamano
2011-05-12  7:14 ` Michael J Gruber
2011-05-12  8:04   ` Jeff King
2011-05-12  8:14     ` Michael J Gruber
2011-05-12  8:22       ` Jeff King
2011-05-12 14:35         ` RFC proposal: set git defaults options from config Michael J Gruber
2011-05-12 22:36           ` David Pisoni
2011-05-16 11:05             ` Jeff King [this message]
2011-05-16 11:02           ` Jeff King
2011-05-16 12:54             ` Michael J Gruber

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=20110516110545.GC23889@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=dpisoni@gmail.com \
    --cc=drmicha@warpmail.net \
    --cc=git@drmicha.warpmail.net \
    --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).