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

Re: [PATCH 3/3] CodingGuidelines: describe naming rules for configuration variables

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Feb 2, 2015, 11:31 UTC
Message-ID
<687227472e6697fadfa9c3237c9c7de0@www.dscho.org>
In-Reply-To
<xmqqwq418dmp.fsf@gitster.dls.corp.google.com>
Hi,
On 2015-02-01 23:34, Junio C Hamano wrote:
Show 9 quoted lines
> Jeff King <peff@peff.net> writes:
> 
>>   1. I'm a user who has set my preferred core.whitespace in my
>>      ~/.gitconfig. A particular project I am working on uses an
>>      alternate tabwidth. How do I set that in the repo config without
>>      repeating my defaults?
> 
> Isn't it cumulative?  At least it should be (but I wouldn't be too
> surprised if the recent config reader caching broke it).
Please note that it is really, really difficult for a regular Git user to figure out which whitespace settings are in effect using just `git config` whether it is cumulative or not.
Also, please note it makes it hard on users that there are a bunch of config settings which *override* previous settings, and others that are *cumulative*.
The latter we cannot change, and the former we cannot change for the whitespace settings. However, when introducing new settings (such as the fsck severity levels), we should go out of our way to keep things as simple as possible. For example, if a *simple* `git config` can answer the question "Is feature XYZ turned on", I would consider the design superior to a design that requires additional code just to figure out whether feature XYZ is turned on, let alone to turn it on without affecting other settings.
In other words, I would like to caution against recommending the whitespace setting as an example to follow: anybody who is unfamiliar with the whitespace setting will find the cumulative last-setting-wins (per item inside the whitespace-separated list, not per config setting) strategy confusing.
On the other hand, if you offer `whitespace.tabWidth` and `whitespace.indentWithNoTab` separately, everything is really crystal clear to new users without having much explaining to do, let alone having to introduce new tooling.

Ciao, Dscho

P.S.: Of course I know that it is too late for `whitespace`, but it offers itself as a good subject to demonstrate the merits of the different suggestions.
Previous: Junio C HamanoNext: Junio C Hamano
Message 13 of 16 in “Documentation/git-add.txt: add `add.ginore-errors` configuration variable”
  1. Documentation/git-add.txt: add `add.ginore-errors` configuration variableAlexander Kuleshov, Jan 26, 2015
  2. Eric SunshineJan 26, 2015
  3. Junio C HamanoJan 27, 2015
  4. 0/3 Documenting naming rules for configuration variablesJunio C Hamano, Jan 28, 2015
  5. 1/3 config.txt: clarify that add.ignore-errors is deprecatedJunio C Hamano, Jan 28, 2015
  6. 2/3 config.txt: mark deprecated variables more prominentlyJunio C Hamano, Jan 28, 2015
  7. 3/3 CodingGuidelines: describe naming rules for configuration variablesJunio C Hamano, Jan 28, 2015
  8. Michael HaggertyFeb 1, 2015
  9. Jeff KingFeb 1, 2015
  10. Junio C HamanoFeb 1, 2015
  11. Jeff KingFeb 1, 2015
  12. Junio C HamanoFeb 1, 2015
  13. Johannes SchindelinFeb 2, 2015
  14. Junio C HamanoFeb 2, 2015
  15. Michael HaggertyFeb 2, 2015
  16. Junio C HamanoFeb 2, 2015

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.