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

Re: [PATCH 1/2] parse-options: allow for configuring option abbreviation

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Mar 26, 2019, 11:00 UTC
Message-ID
<87ef6tc33c.fsf@evledraar.gmail.com>
In-Reply-To
<CACsJy8BpToq2VAzFo61dz7Hco42Sbka5qQm3ACn_6aejUxAKOg@mail.gmail.com>
On Tue, Mar 26 2019, Duy Nguyen wrote:
Show 19 quoted lines
> On Tue, Mar 26, 2019 at 1:29 PM Ævar Arnfjörð Bjarmason
> <avarab@gmail.com> wrote:
>> I don't see how a new "abbreviatedOptions" is plausibly going to crowd
>> out anything else, sounds pretty unambiguous to me.
>
> By crowded I mean a lot of configuration variables under "core"
>
>> By my count out of the the existing GIT_* variables in git.txt around
>> 1/3 are already configurable via config, another 1/3 (all the GIT_TRACE
>> stuff) is something we've wanted to have configurable in the past (but
>> nobody's gotten around to writing patches for).
>>
>> I think it's fair to say that when we normally add user-configurable
>> stuff we do it as config, not as new env vars.
>
> I disagree that not every configuration knob has to be a configuration
> variable, especially when core.* more or less becomes a dictionary
> that you can't really read anymore (unless you know the key to look
> for). But I see you're dead set on adding config vars. Go ahead.

I don't mean to pile on in this thread, and cards on the table: In terms of stuff I can be bothered to write a patch for and stuff I *really* want in git, this thing is maybe on a 2/10 out of a 1-10 scale.

I.e. I'd use it, and it would probably save my ass *somewhere* down the line, the motivation was being bitten in the past, so once I spotted Johannes's series I was reminded to clean it up & submit it. But I wouldn't care enough to carry a forked git with this (unlike some other stuff).

I just wanted to elaborate *in general* on the question of "why config and not env".

I don't think everything we find reason to add a knob for needs to be a config variable. E.g. I can't think of a reason for why the GIT_*_PATHSPECS variables should be. That seems like the sort of thing you'd only tweak for a *specific* git invocation. I wouldn't oppose it being config if someone had a compelling reason & patch, but can't think of one myself.

What I wanted to get across in the above replies to you/Eric, but probably did a bad job of is that separate & aside from the merits of any given new config variable there's the problem of being a "zookeeper" with large git installations.

I.e. you don't even pick the animals, or feed them, but if the zoo's on fire or overflowing with poop it's your problem.

So I have some servers where I'm in charge of maintaining/upgrading git, and it's on me if crap breaks in the aggregate, but I'm not writing anyone's individual scripts for them, and the runtime envs for those might be varied.

It's for those sorts of cases where having the flexibility of turning something on either in the env or via system-wide or user-wide config is handy. I.e. in this case I might say:

    "You can run your scripts, but you'll be in 'strict mode' and need
    to spell out your options, because I'm not getting out of bed if
    your random job using git breaks because you were lazy and did a
    'git init --ba'".

I don't think this is a use-case that's obvious, so it's worth elaborating on it. I suspect a lot of devs/users on this list have advanced git use-cases, but they're all ones where the git processes they care about/need to maintain run as a child of their login shell, or equivalent. In that case the config v.s. env var distinction mostly doesn't matter.

Previous: Duy NguyenNext: Junio C Hamano
Message 23 of 52 in “Do not use abbreviated options in tests”
  1. 0/8 Do not use abbreviated options in testsJohannes Schindelin via GitGitGadget, Mar 25, 2019
  2. 1/8 tests (rebase): spell out the `--keep-empty` optionJohannes Schindelin via GitGitGadget, Mar 25, 2019
  3. 3/8 t7810: do not abbreviate `--no-exclude-standard` nor `--invert-match`Johannes Schindelin via GitGitGadget, Mar 25, 2019
  4. 5/8 tests (push): do not abbreviate the `--follow-tags` optionJohannes Schindelin via GitGitGadget, Mar 25, 2019
  5. 4/8 t5531: avoid using an abbreviated optionJohannes Schindelin via GitGitGadget, Mar 25, 2019
  6. 2/8 tests (rebase): spell out the `--force-rebase` optionJohannes Schindelin via GitGitGadget, Mar 25, 2019
  7. 8/8 tests: disallow the use of abbreviated options (by default)Johannes Schindelin via GitGitGadget, Mar 25, 2019
  8. Denton LiuMar 25, 2019
  9. Ævar Arnfjörð BjarmasonMar 25, 2019
  10. Johannes SchindelinApr 12, 2019
  11. Johannes SchindelinApr 12, 2019
  12. Ævar Arnfjörð BjarmasonMar 25, 2019
  13. Johannes SchindelinApr 12, 2019
  14. 6/8 tests (status): spell out the `--find-renames` option in fullJohannes Schindelin via GitGitGadget, Mar 25, 2019
  15. 7/8 tests (pack-objects): use the full, unabbreviated `--revs` optionJohannes Schindelin via GitGitGadget, Mar 25, 2019
  16. 0/2 allow for configuring option abbreviation + fixÆvar Arnfjörð Bjarmason, Mar 25, 2019
  17. 1/2 parse-options: allow for configuring option abbreviationÆvar Arnfjörð Bjarmason, Mar 25, 2019
  18. Eric SunshineMar 25, 2019
  19. Ævar Arnfjörð BjarmasonMar 25, 2019
  20. Duy NguyenMar 26, 2019
  21. Ævar Arnfjörð BjarmasonMar 26, 2019
  22. Duy NguyenMar 26, 2019
  23. Ævar Arnfjörð BjarmasonMar 26, 2019
  24. Junio C HamanoApr 1, 2019
  25. Johannes SchindelinApr 12, 2019
  26. 2/2 parse-options: don't emit "ambiguous option" for aliasesÆvar Arnfjörð Bjarmason, Mar 25, 2019
  27. parse-options: don't emit "ambiguous option" for aliasesÆvar Arnfjörð Bjarmason, Apr 17, 2019
  28. Duy NguyenApr 17, 2019
  29. Junio C HamanoApr 18, 2019
  30. Duy NguyenApr 18, 2019
  31. Junio C HamanoApr 19, 2019
  32. parse-options: don't emit "ambiguous option" for aliasesNguyễn Thái Ngọc Duy, Apr 22, 2019
  33. Duy NguyenApr 22, 2019
  34. parse-options: don't emit "ambiguous option" for aliasesNguyễn Thái Ngọc Duy, Apr 29, 2019
  35. Junio C HamanoMay 7, 2019
  36. Duy NguyenMay 7, 2019
  37. Junio C HamanoApr 2, 2019
  38. 0/8 Do not use abbreviated options in testsJohannes Schindelin via GitGitGadget, Apr 12, 2019
  39. 2/8 tests (rebase): spell out the `--force-rebase` optionJohannes Schindelin via GitGitGadget, Apr 12, 2019
  40. 4/8 t5531: avoid using an abbreviated optionJohannes Schindelin via GitGitGadget, Apr 12, 2019
  41. 6/8 tests (status): spell out the `--find-renames` option in fullJohannes Schindelin via GitGitGadget, Apr 12, 2019
  42. 5/8 tests (push): do not abbreviate the `--follow-tags` optionJohannes Schindelin via GitGitGadget, Apr 12, 2019
  43. 1/8 tests (rebase): spell out the `--keep-empty` optionJohannes Schindelin via GitGitGadget, Apr 12, 2019
  44. 3/8 t7810: do not abbreviate `--no-exclude-standard` nor `--invert-match`Johannes Schindelin via GitGitGadget, Apr 12, 2019
  45. 8/8 tests: disallow the use of abbreviated options (by default)Johannes Schindelin via GitGitGadget, Apr 12, 2019
  46. Junio C HamanoApr 14, 2019
  47. Junio C HamanoApr 15, 2019
  48. Johannes SchindelinApr 15, 2019
  49. Junio C HamanoApr 15, 2019
  50. Johannes SchindelinApr 17, 2019
  51. Johannes SchindelinApr 15, 2019
  52. 7/8 tests (pack-objects): use the full, unabbreviated `--revs` optionJohannes Schindelin via GitGitGadget, Apr 12, 2019

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.