Re: [PATCH 0/5] Introduce configs for default repo format
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Aug 16, 2024, 08:07 UTC
- Message-ID
- <Zr8IpMXjN94xnC0W@tanuki>
- In-Reply-To
- <xmqq4j7lsbca.fsf@gitster.g>
On Thu, Aug 15, 2024 at 02:52:21PM -0700, Junio C Hamano wrote:
Show 28 quoted lines
> "brian m. carlson" <sandals@crustytoothpaste.net> writes: > > > On 2024-08-15 at 15:24:47, shejialuo wrote: > >> If the user uses the following command: > >> > >> $ export GIT_DEFAULT_HASH_ENVIRONMENT=sha1 > >> $ git -c init.defaultObjectFormat=sha256 repo > >> > >> The repo would be initialized with the sha1 algorithm. I think we should > >> think carefully which precedence should be higher. I cannot give an > >> answer here. I am not familiar with the whole database and do not the > >> concern. But from my own perspective, I think the precedence of the > >> config should be higher than the environment variable. This is a new > >> feature, the people who would like to use it, they will never use > >> environment variable and we should ignore the functionality of the > >> environment variable. But for people who do not know this feature, they > >> will continue to use the environment variable and they will never be > >> influenced by the configs. > > > > The standard behaviour we have with other environment variables is that > > they override the config, such as with `GIT_SSH_COMMAND` and > > `GIT_SSH_VARIANT`. The reason is that the config in this case is > > usually per-user or per-system, but it's very common to override > > settings on an ephemeral basis with the environment. > > Right. It is good that somebody can give a clear answer when a new > person says they cannot and then give an answer that contradicts > with an established practice ;-).
Yeah, thanks for putting it so clearly. I'll also put a variant of this into the commit message to clarify.
Patrick