git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: RFC proposal: set git defaults options from config

From
Jeff King <peff@peff.net>
Date
May 16, 2011, 11:05 UTC
Message-ID
<20110516110545.GC23889@sigill.intra.peff.net>
In-Reply-To
<2235D93D-4F02-42D7-88B1-74F692D58AA5@gmail.com>
On Thu, May 12, 2011 at 03:36:16PM -0700, David Pisoni wrote:
Show 6 quoted lines
> 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.

Show 5 quoted lines
> 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
Previous: David PisoniNext: Jeff King
Message 12 of 14 in “Adds 'stash.index' configuration option”
  1. Adds 'stash.index' configuration optionDavid Pisoni, May 11, 2011
  2. Junio C HamanoMay 11, 2011
  3. Junio C HamanoMay 12, 2011
  4. David PisoniMay 12, 2011
  5. Junio C HamanoMay 12, 2011
  6. Michael J GruberMay 12, 2011
  7. Jeff KingMay 12, 2011
  8. Michael J GruberMay 12, 2011
  9. Jeff KingMay 12, 2011
  10. RFC proposal: set git defaults options from configMichael J Gruber, May 12, 2011
  11. David PisoniMay 12, 2011
  12. Jeff KingMay 16, 2011
  13. Jeff KingMay 16, 2011
  14. Michael J GruberMay 16, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.