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

Re: [PATCH v2 4/5] setup: make object format configurable via config

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 16, 2024, 17:13 UTC
Message-ID
<xmqqed6ol7bw.fsf@gitster.g>
In-Reply-To
<85086620628b1fa136ebf7a1c9e2f64ebdbc7b92.1723798388.git.ps@pks.im>
Patrick Steinhardt <ps@pks.im> writes:
Show 11 quoted lines
> The precedence order now is the following, where the first one wins:
>
>   1. The `--object-format=` switch.
>
>   2. The `GIT_DEFAULT_HASH` environment variable.
>
>   3. The `init.defaultObjectFormat` config variable.
>
> This matches the typical precedence order we use in Git. We typically
> let the environment override the config such that the latter can easily
> be overridden on an ephemeral basis, for example by scripts.

Thanks for documenting this, as the reason for deciding the precedence between environment and configuration is no longer as strong as it used to be.

Before the "git -c var=val" happened, the only sensible preference order was to allow environment to override a configured default by doing "VAR=val git cmd ...". In other words, the order used to be something you could safely forget and still infer the right order with logic alone.

But with "git -c var=val", even if a hypothetical Git allowed configuration to override environment, a user could still override them with "-c var=val", so "environment trumps configuration" is no longer "because there is no sensible workaround if it were the other way around", but merely "because that used to be the only logical way".

Previous: Patrick SteinhardtNext: Justin Tobler
Message 23 of 24 in “Introduce configs for default repo format”
  1. 0/5 Introduce configs for default repo formatPatrick Steinhardt, Aug 15, 2024
  2. 1/5 t0001: exercise initialization with ref formats more thoroughlyPatrick Steinhardt, Aug 15, 2024
  3. Justin ToblerAug 15, 2024
  4. 2/5 t0001: delete repositories when object format tests finishPatrick Steinhardt, Aug 15, 2024
  5. 3/5 setup: merge configuration of repository formatsPatrick Steinhardt, Aug 15, 2024
  6. Justin ToblerAug 15, 2024
  7. Patrick SteinhardtAug 16, 2024
  8. 5/5 setup: make ref storage format configurable via configPatrick Steinhardt, Aug 15, 2024
  9. Justin ToblerAug 15, 2024
  10. 4/5 setup: make object format configurable via configPatrick Steinhardt, Aug 15, 2024
  11. Justin ToblerAug 15, 2024
  12. shejialuoAug 15, 2024
  13. brian m. carlsonAug 15, 2024
  14. Junio C HamanoAug 15, 2024
  15. Patrick SteinhardtAug 16, 2024
  16. brian m. carlsonAug 15, 2024
  17. 0/5 Introduce configs for default repo formatPatrick Steinhardt, Aug 16, 2024
  18. 2/5 t0001: delete repositories when object format tests finishPatrick Steinhardt, Aug 16, 2024
  19. 5/5 setup: make ref storage format configurable via configPatrick Steinhardt, Aug 16, 2024
  20. 3/5 setup: merge configuration of repository formatsPatrick Steinhardt, Aug 16, 2024
  21. 1/5 t0001: exercise initialization with ref formats more thoroughlyPatrick Steinhardt, Aug 16, 2024
  22. 4/5 setup: make object format configurable via configPatrick Steinhardt, Aug 16, 2024
  23. Junio C HamanoAug 16, 2024
  24. Justin ToblerAug 16, 2024

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.