git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Patrick Steinhardt <ps@pks.im>
Cc: git@vger.kernel.org,  Sebastian Schuberth <sschuberth@gmail.com>,
	Justin Tobler <jltobler@gmail.com>,
	 "brian m. carlson" <sandals@crustytoothpaste.net>
Subject: Re: [PATCH v2 4/5] setup: make object format configurable via config
Date: Fri, 16 Aug 2024 10:13:07 -0700	[thread overview]
Message-ID: <xmqqed6ol7bw.fsf@gitster.g> (raw)
In-Reply-To: <85086620628b1fa136ebf7a1c9e2f64ebdbc7b92.1723798388.git.ps@pks.im> (Patrick Steinhardt's message of "Fri, 16 Aug 2024 10:57:03 +0200")

Patrick Steinhardt <ps@pks.im> writes:

> 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".


  reply	other threads:[~2024-08-16 17:13 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-15  7:59 [PATCH 0/5] Introduce configs for default repo format Patrick Steinhardt
2024-08-15  7:59 ` [PATCH 1/5] t0001: exercise initialization with ref formats more thoroughly Patrick Steinhardt
2024-08-15 20:35   ` Justin Tobler
2024-08-15  8:00 ` [PATCH 2/5] t0001: delete repositories when object format tests finish Patrick Steinhardt
2024-08-15  8:00 ` [PATCH 3/5] setup: merge configuration of repository formats Patrick Steinhardt
2024-08-15 21:37   ` Justin Tobler
2024-08-16  8:06     ` Patrick Steinhardt
2024-08-15  8:00 ` [PATCH 4/5] setup: make object format configurable via config Patrick Steinhardt
2024-08-15 22:17   ` Justin Tobler
2024-08-15  8:00 ` [PATCH 5/5] setup: make ref storage " Patrick Steinhardt
2024-08-15 22:29   ` Justin Tobler
2024-08-15 15:24 ` [PATCH 0/5] Introduce configs for default repo format shejialuo
2024-08-15 21:16   ` brian m. carlson
2024-08-15 21:52     ` Junio C Hamano
2024-08-16  8:07       ` Patrick Steinhardt
2024-08-15 21:22 ` brian m. carlson
2024-08-16  8:56 ` [PATCH v2 " Patrick Steinhardt
2024-08-16  8:56   ` [PATCH v2 1/5] t0001: exercise initialization with ref formats more thoroughly Patrick Steinhardt
2024-08-16  8:56   ` [PATCH v2 2/5] t0001: delete repositories when object format tests finish Patrick Steinhardt
2024-08-16  8:56   ` [PATCH v2 3/5] setup: merge configuration of repository formats Patrick Steinhardt
2024-08-16  8:57   ` [PATCH v2 4/5] setup: make object format configurable via config Patrick Steinhardt
2024-08-16 17:13     ` Junio C Hamano [this message]
2024-08-16  8:57   ` [PATCH v2 5/5] setup: make ref storage " Patrick Steinhardt
2024-08-16 14:46   ` [PATCH v2 0/5] Introduce configs for default repo format Justin Tobler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqed6ol7bw.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jltobler@gmail.com \
    --cc=ps@pks.im \
    --cc=sandals@crustytoothpaste.net \
    --cc=sschuberth@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).