From: Patrick Steinhardt <ps@pks.im>
To: git@vger.kernel.org
Cc: Sebastian Schuberth <sschuberth@gmail.com>,
Justin Tobler <jltobler@gmail.com>,
"brian m. carlson" <sandals@crustytoothpaste.net>,
Junio C Hamano <gitster@pobox.com>
Subject: [PATCH v2 0/5] Introduce configs for default repo format
Date: Fri, 16 Aug 2024 10:56:50 +0200 [thread overview]
Message-ID: <cover.1723798388.git.ps@pks.im> (raw)
In-Reply-To: <cover.1723708417.git.ps@pks.im>
Hi,
this is the second version of my patch series that introduces two new
config settings `init.defaultRefFormat` and `init.defaultObjectFormat`
to make the default formats configurable without environment variables.
Changes compared to v1:
- Extend commit message to mention that we also move
`repo_set_ref_storage_format()` and `repo_set_hash_algo()` into
`repository_format_configure()`.
- Extend commit message to explain precedence.
- Fix a grammar issue.
- Fix a copy/paste error in the documentation of
`init.defaultRefFormat`.
Thanks!
Patrick
Patrick Steinhardt (5):
t0001: exercise initialization with ref formats more thoroughly
t0001: delete repositories when object format tests finish
setup: merge configuration of repository formats
setup: make object format configurable via config
setup: make ref storage format configurable via config
Documentation/config/init.txt | 10 +++
setup.c | 101 ++++++++++++++++-------
t/t0001-init.sh | 145 +++++++++++++++++++++++++++++++---
3 files changed, 216 insertions(+), 40 deletions(-)
Range-diff against v1:
1: 0d3844db32 = 1: 0d3844db32 t0001: exercise initialization with ref formats more thoroughly
2: 6b0cefef6a = 2: 6b0cefef6a t0001: delete repositories when object format tests finish
3: 16f52b75d8 ! 3: ce0fad88bb setup: merge configuration of repository formats
@@ Commit message
or read the config multiple times. Both of these options feel a bit
unwieldy.
- Merge the code into a new a new function `repository_format_configure()`
- that is responsible for configuring the whole repository's format. Like
- this, we can easily read the config in a single place, only.
+ Merge the code into a new function `repository_format_configure()` that
+ is responsible for configuring the whole repository's format. Like this,
+ we can easily read the config in a single place, only.
+
+ Furthermore, move the calls to `repo_set_ref_storage_format()` and
+ `repo_set_hash_algo()` into this new function as well, such that all the
+ logic to configure the repository format is self-contained here.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
4: e1cdaf0f0e ! 4: 8508662062 setup: make object format configurable via config
@@ Commit message
"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>
## Documentation/config/init.txt ##
5: a0417b7d1a ! 5: b68a841450 setup: make ref storage format configurable via config
@@ Metadata
## Commit message ##
setup: make ref storage format configurable via config
- Similar as the preceding commit, introduce a new "init.defaultRefFormat"
+ Similar to the preceding commit, introduce a new "init.defaultRefFormat"
config that allows the user to globally set the ref storage format used
by newly created repositories.
@@ Documentation/config/init.txt: endif::[]
and the `GIT_DEFAULT_HASH` environment variable take precedence over
this config.
+`init.defaultRefFormat`::
-+ Allows overriding the default object format for new repositories. See
-+ `--ref-format=` in linkgit:git-init[1]. Both the command line option
-+ and the `GIT_DEFAULT_REF_FORMAT` environment variable take precedence
-+ over this config.
++ Allows overriding the default ref storage format for new repositories.
++ See `--ref-format=` in linkgit:git-init[1]. Both the command line
++ option and the `GIT_DEFAULT_REF_FORMAT` environment variable take
++ precedence over this config.
## setup.c ##
@@ setup.c: static void separate_git_dir(const char *git_dir, const char *git_link)
--
2.46.0.46.g406f326d27.dirty
next prev parent reply other threads:[~2024-08-16 9:06 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 ` Patrick Steinhardt [this message]
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
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=cover.1723798388.git.ps@pks.im \
--to=ps@pks.im \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=jltobler@gmail.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.