[PATCH 0/6] quote_path() clean-ups
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 8, 2020, 20:52 UTC
- Message-ID
- <20200908205224.4126551-1-gitster@pobox.com>
- In-Reply-To
- <20200908013013.1099937-1-sandals@crustytoothpaste.net>
So, this is an alternative approach to tackle the same issue <xmqq4ko8yxp9.fsf@gitster.c.googlers.com> tried to address. It ended up to be more involved than I would have liked, but it was primarily because it needed some function signature changes. The overall structure of the series is:
(1) rename quote_path_relative() to quote_path().
(2) allow quote_path() to take a flags parameter and update all the
callers to pass 0 (all bits false) (3) move the "always quote a path with SP in it, even if there is
no byte that needs quoting" logic out of wt-status.c that is
used to show "git status --short" for tracked paths to
quote_path() and give it the QUOTE_PATH_QUOTE_SP bit in the
flags parameter. (4) using QUOTE_PATH_QUOTE_SP bit, apply the "always quote a path
with SP" to "git status --short" output for untracked, ignored
and unmerged paths.Patches (5) and (6) are not strictly necessary. They are what I found while reading the existing code and thought it might, or might not, be worth cleaning up and couldn't decide ;-)
Junio C Hamano (6): quote_path: rename quote_path_relative() to quote_path() quote_path: give flags parameter to quote_path() quote_path: optionally allow quoting a path with SP in it wt-status: consistently quote paths in "status --short" output quote: rename misnamed sq_lookup[] to cq_lookup[] quote: turn 'nodq' parameter into a set of flags
builtin/clean.c | 22 +++++++++++----------- builtin/grep.c | 2 +- diff.c | 8 ++++---- quote.c | 39 ++++++++++++++++++++++++--------------- quote.h | 11 +++++++---- t/t7508-status.sh | 21 +++++++++++++++++++++ wt-status.c | 37 +++++++++++++------------------------ 7 files changed, 81 insertions(+), 59 deletions(-)
-- 2.28.0-539-g66371d8995