[PATCH v4 0/5] builtin/config: bug fixes for "get" subcommand with "--type=color"
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Sep 22, 2025, 13:06 UTC
- Message-ID
- <20250922-pks-config-color-v4-0-28b7d2697eed@pks.im>
- In-Reply-To
- <20250911-pks-config-color-v1-0-3a7c79df65b1@pks.im>
Hi,
this small patch series contains two bug fixes for `git config get --type=color`:
- We restore the behaviour where we can now parse colors without a
config key. - We stop spawning the pager when the user requests to print ANSI
color escape sequences.Furthermore, the patch series does some lighter refactorings of t1300. That test file still has its fair share of issues, but at least it looks a bit less dirty now.
Changes in v2: - Improve commit messages. - Use "\EOF" and "-EOF" in more cases. - Move a style fixup from the first commit into the second commit. - Link to v1: https://lore.kernel.org/r/20250911-pks-config-color-v1-0-3a7c79df65b1@pks.im
Changes in v3:
- Provide additional context as part of the commit message for the
commit that stops setting up the pager with `--type=color`.
- Link to v2: https://lore.kernel.org/r/20250915-pks-config-color-v2-0-e4290bd8d13c@pks.imChanges in v4: - Fix a commit message grammar bug. - Link to v3: https://lore.kernel.org/r/20250918-pks-config-color-v3-0-08ea618cae26@pks.im
Thanks!
Patrick
---
Patrick Steinhardt (5):
t1300: write test expectations in the test's body
t1300: small style fixups
builtin/config: do not die in `get_color()`
builtin/config: special-case retrieving colors without a key
builtin/config: do not spawn pager when printing color codesbuiltin/config.c | 20 +++- t/t1300-config.sh | 349 +++++++++++++++++++++++++++--------------------------- 2 files changed, 187 insertions(+), 182 deletions(-)
Range-diff versus v3:
1: e62108edc8 = 1: 8d873d65de t1300: write test expectations in the test's body
2: deef91062a = 2: 39eeb35d43 t1300: small style fixups
3: 58940b2cf9 = 3: ee22438222 builtin/config: do not die in `get_color()`
4: 288d51d1c0 ! 4: 44b1d54527 builtin/config: special-case retrieving colors without a key
@@ Commit message
- If the provided config key is empty;
- - the user is asking for a color code and the user; and
+ - the user is asking for a color code; and
- the user has provided a default value,
5: 9a3adf8795 = 5: b4d72c21f5 builtin/config: do not spawn pager when printing color codes--- base-commit: ab427cd991100e94792fce124b0934135abdea4b change-id: 20250911-pks-config-color-e5b8a213e895