summaryrefslogtreecommitdiffstats
path: root/man
diff options
context:
space:
mode:
authorBrian Gan <brgan@google.com>2026-06-30 21:38:51 +0000
committergerrit-scoped@luci-project-accounts.iam.gserviceaccount.com <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com>2026-07-01 15:59:45 -0700
commit35bbf701d04de5c6a71937279bc3d16f6ce36808 (patch)
treedd85fb9c0d2fcaa8b5685fe8e775ca1cf6ab17a3 /man
parent881af15cdc4a72894adc9e6b9504e6ca6d4d7c8e (diff)
downloadgit-repo-2.65.tar.gz
color: Treat "true" and "yes" as "auto", not "always"v2.65
Per the git documentation for color.ui [1], setting color.ui to "true" (or "yes") should behave identically to "auto", enabling color only when output is written to a terminal or an active pager. Previously, repo was equating "true" and "yes" with "always", which caused color escape codes to be emitted unconditionally, even when output was piped or redirected. Replace the duplicated string-matching logic in SetDefaultColoring and Coloring.__init__ with a single CONFIG_TO_COLOR_SETTING dict that maps all git color config values to their behavior. This makes the mapping easy to verify against the git docs and impossible to get out of sync between the two call sites. Added tests for SetDefaultColoring and Coloring.__init__ covering all color mode values (auto, true, yes, always, never, no, false), case insensitivity, TTY vs pipe behavior, active pager detection, and unrecognised input. [1] https://git-scm.com/docs/git-config#Documentation/git-config.txt-colorui Bug: 295841573 Change-Id: I8a04b9c7e4154de37ed7518c010233039e0afdc9 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/602981 Tested-by: Brian Gan <brgan@google.com> Reviewed-by: Gavin Mak <gavinmak@google.com> Commit-Queue: Brian Gan <brgan@google.com>
Diffstat (limited to 'man')
0 files changed, 0 insertions, 0 deletions