summaryrefslogtreecommitdiff
path: root/t/unit-tests/t-oid-array.c
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-08-16 10:57:03 +0200
committerJunio C Hamano <gitster@pobox.com>2024-08-16 09:55:21 -0700
commit0c22e09b7376ce9c010e5901108bab08e5ec2b2c (patch)
treedb58d932fd86879b9d5c3623c84a6983983200f4 /t/unit-tests/t-oid-array.c
parent39e15b789ad3c3a192f4c8abde3daff83a053aaa (diff)
setup: make object format configurable via config
The object format for repositories can either be configured explicitly by passing the `--object-format=` option to git-init(1) or git-clone(1), or globally by setting the `GIT_DEFAULT_HASH` environment variable. While the former makes sense, setting random environment variables is not really a good user experience in case someone decides to only use SHA256 repositories. It is only natural to expect for a user that things like this can also be configured via their config. As such, introduce a new config "init.defaultObjectFormat", similar to "init.defaultBranch", that allows the user to configure the default object format when creating new repos. 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. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/unit-tests/t-oid-array.c')
0 files changed, 0 insertions, 0 deletions