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
Junio C Hamano <gitster@pobox.com>
Date
Feb 2, 2015, 18:39 UTC
Message-ID
<xmqq7fw0uphd.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20150201215729.GA19692@peff.net>
Jeff King <peff@peff.net> writes:

I didn't reply to the latter part of this message yesterday, because I wanted to think more on it.

Show 5 quoted lines
> But is it such a bad thing to have them in conflict? Can't we define a
> set of rules that does what people expects? For example, by the "last
> one wins" principle, any time we see "whitespace.tab-in-indent", it
> clears the setting of "whitespace.indent-with-non-tab", and vice versa.
> This isn't represented syntactically in the config file, ...

I agree. Both one-variable-per-knob and value-with-list-of-knobs do not express the semantic linkage between knobs; once we convince the users that one-variable-per-knob format does not mean they represent independent and orthgonal settings, the issue becomes a trade-off between

 * Is it concise to let end users skim through?
 * Is it easy to parse by scripters?
Show 15 quoted lines
> By the way, this is the exact case I am concerned about for fsck.*. Our
> use case at GitHub would be something like:
>
>   a. We set up sane defaults for fsck.* in /etc/gitconfig
>
>   b. User complains that we will not accept their push, which contains
>      objects with malformed committers.
>
>   c. Support investigates, determines that the malformed objects are
>      part of a well-established history, and that they are OK to enter.
>
>   d. We relax fsck.committerIdent in that repo's $GIT_DIR/config file.
>
> Copy-and-pasting the rest of the rules from (a) into the repo config
> file in step (d) is not ideal.

It probably can be worked around by the later-one-wins rule per item, e.g. after seeing "fsck.ignore = A B C" in /etc/gitconfig and then seeing "fsck.error = B" in $GIT_DIR/config, the latter will flip the three-way radio button for B from ignore to error (the other possible setting of the radio button is 'warn'), while leaving the three-way radio buttons for A and C set to ignore.

We can (and have to) do the same with "fsck.B = ignore" in /etc/gitconfig that gets overridden by "fsck.B = error" in $GIT_DIR/config, and that comes _free_, which makes it an attractive proposition.

As I already said, I am fine with "fsck.missingTagger = ignore".
Previous: Johannes SchindelinNext: Michael Haggerty
Message 14 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.