Re: [PATCH 0/5] Introduce configs for default repo format
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Aug 15, 2024, 21:52 UTC
- Message-ID
- <xmqq4j7lsbca.fsf@gitster.g>
- In-Reply-To
- <Zr5wODo8tgGtPEIM@tapette.crustytoothpaste.net>
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
Show 22 quoted lines
> 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 ;-).